COMP163 Acreage This lab quiz is to be done individually by each student. You ma
ID: 3750848 • Letter: C
Question
COMP163 Acreage This lab quiz is to be done individually by each student. You may use your notes, textbook, previous assignments and the web when writing your program. You are not to talk, email, text or phone others when working on your program. The TAs will provide limited assistance, primarily to explain the assignment on error messages. You must be physically present in the Graham 203 lab to take the lab quiz. that calculates how many acres is a Write a program program should ask for the two dimensions of the land in feet and then display the size in acres. There are 43,560 square feet in an acre. rectangular field of given dimensions. The You can write the program with or without a Graphics User Interface. The maximum score possible for a command line program is 82 points while the maximum possible score for the GUI version is 100 points, Write the program as an application or with a GUI, do not do both. The normal grading criteria will be used. version A [max 82 points] Write a command line program to calculate the acreage Enter the length of two sides of the land 300 150 The land is 1.0330578512396693 acres version B [max 100 points] Write a program with a Graphical User Interface that calculates the acreage nter length of side 1 Upload only version A or version B, but not boh, to Blackboard before the0 end of your lab period. Programs MUST be uploaded before the end of nd side 2 your lab period or you will not receive credit for the program. calc acres are 1.0330578Explanation / Answer
Given below is the code for the question.
To indent code in eclipse , select code by pressing ctrl+a and then indent using ctrl+i
Please do rate the answer if it was helpful. Thank you
import java.util.Scanner;
public class Acreage {
public static void main(String[] args) {
double length, width;
Scanner keyboard = new Scanner(System.in);
double areaSqft;
double // 1 acre = 43560 sqft
double numAcres;
System.out.println("Enter the length of two sides of the land");
length = keyboard.nextDouble();
width = keyboard.nextDouble();
areaSqft = length * width;
numAcres = areaSqft / ONE_ACRE;
System.out.println("The land is " + numAcres + " acres");
}
}
output
-----
Enter the length of two sides of the land
300 150
The land is 1.0330578512396693 acres
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.