java
A lot of people have been in the real estate market this year and 2 measurements are used to measure land, acres and hectares.
You are writing a program to convert acres to hectares for lots of land given in acres. You begin by asking the user how many conversions that they want to make for lots of land. Once you have a response, a for loop is entered for processing the lots of land.
You will input the lot# and the acres for the lot and this information will be stored in parallel arrays. Use a value returning method to validate the value of the acres to make sure that it is not <1 acre. Print the lot#, and the acres within a 2nd for loop. Find the lot with the smallest acreage. Use a void method convertHectares that converts the sum of the acres of land processed by a factor of 2.471052, and then displays the Hectares.
The following methods are required in this program:
A value returning method to validate the acres to make sure that it is at least 1.
A void method to convert the sum of the acres to hectares and display the result.
Below is the output of the program with some test data. Remember your program must run for any number of years and bushels of tomatoes and not just these years and bushels.
Other reminders:
Use camelCase correctly
Indent correctly
Comment at the top of each program and within each program
Use print formatting to show 1 decimal place in the output for the total Bushels of Tomatoes and total Cubic Feet.
Use the test data given for testing.
Do not use object oriented classes and methods in this program that you may find on the Internet. This program must use a procedural approach.
Here is how the program will run. Test data input is italicized and bolded.
Let's analyze lot acreage for several lots.
Please enter the number of lots:
3
Please enter the lot#.
Abc123
Please enter the acreage for lot Abc123.
1
Please enter the lot#.
Bcd234
Please enter the acreage for lot Bcd234.
2
Please enter the lot#.
Cde345
Please enter the acreage for lot Cde345.
0
Invalid. Please enter a value that is at least 1.
7
------Acreage Conversions------
Abc123 1
Bcd234 2
Cde345 7
The lot with the smallest acreage is Abc123 with 1 acre.
The total hectares converted from acres is 24.71052.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images
- In javaarrow_forwardC Language - Write a program that takes in three integers and outputs the largest value. If the input integers are the same, output the integers' value.arrow_forwardStarting out with python fourth edition Tony Gaddis. I know I sent this one, but the problem was incorrect. It is a programming exercise, I am sorry if I did not make that clear. It is Chapter 5 programming exercise problem 12. Maximum of two Numbers.arrow_forward
- C++ continued you already gave me the help from the first part. now they have added another set of instructions. original code used. Explanation Here I have created the main method. Inside the main method, I have taken input from the user for height and width and stored them into different variables. Next, I have created a loop that runs till it reaches the height of the rectangle. Inside the loop, I have created another loop that runs till the width of the rectangle. In the inner loop, I have printed the asterisk symbol. After the inner loop, I have used endl to give break and move the pointer to the new line. arrow_forward Answer C++ code: #include<iostream>using namespace std; int main(){ int height, width; // user input cin >> height >> width; // outer loop for(int i = 0; i < height; i++) { // inner loop for(int j = 0; j < width; j++) { //printing the * symbol cout << "*"; }…arrow_forwardMUST BE IN PYTHON PROGRAMMING CODE!!!!! NO C++ or Java!! Directions: Design a program with a loop that lets the user enter a series of names (in no particular order). After the final person’s name has been entered, the program should display the name that is first alphabetically and the name that is last alphabetically. For example, if the user enters the names Kristin, Joel, Adam, Beth, Zeb, and Chris, the program would display Adam and Zeb. Additional requirements: Note that the possible set of input values can include negative, 0, or positive values, but not the sentinel value of -99. DESIGN HINT: • When determining the largest (or smallest) value in a set of numbers, remember to use variables to keep track of the current largest (or smallest) number found thus far. These variables can then be used as a comparison to each subsequent input number to see if the new number is larger (or smaller) than the current largest (or smallest) number and updated appropriately. At the end of all…arrow_forwardAccumulating Totals in a Loop Summary In this lab, you add a loop and the statements that make up the loop body to a Java program that is provided. When completed, the program should calculate two totals: the number of left-handed people and the number of right-handed people in your class. Your loop should execute until the user enters the character X instead of L for left-handed or R for right-handed. The inputs for this program are as follows: R, R, R, L, L, L, R, L, R, R, L, X Variables have been declared for you, and the input and output statements have been written. Instructions Ensure the file named LeftOrRight.java is open. Write a loop and a loop body that allows you to calculate a total of left-handed and right-handed people in your class. Execute the program by clicking Run and using the data listed above and verify that the output is correct.arrow_forward
- In C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: .......................... $3575.00 Federal Tax: ................................ $ 536.25 State Tax: .....................................$ 125.13 Social Security Tax: ................... $ 205.56 Medicare/Medicaid Tax: ......... $ 98.31 Pension Plan: .............................. $ 178.75 Health Insurance: .......................$ 75.00 Net Pay: ....................................... $2356.00 NOTE: The first column is left-justified, and the right column is…arrow_forwardc++ code Screenshot and code is mustarrow_forwardPrimeAA.java Write a program that will tell a user if their number is prime or not. Your code will need to run in a loop (possibly many loops) so that the user can continue to check numbers. A prime is a number that is only divisible by itself and the number 1. This means your code should loop through each value between 1 and the number entered to see if it’s a divisor. If you only check for a small handful of numbers (such as 2, 3, and 5), you will lose most of the credit for this project. Include a try/catch to catch input mismatches and include a custom exception to catch negative values. If the user enters 0, the program should end. Not only will you tell the user if their number is prime or not, you must also print the divisors to the screen (if they exist) on the same line as shown below AND give a count of how many divisors there are. See examples below. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output…arrow_forward
- Instruction: It should be a C++ PROGRAM INCLUDE THE HEADER FILE, MAIN CPP, AND BSTREE.CPP There is a real program developed by a computer company that reads a report ( running text ) and issues warnings on style and partially corrects bad style. You are to write a simplified version of this program with the following features: Statistics A statistical summary with the following information: Total number of words in the report Number of unique words Number of unique words of more than three letters Average word length Average sentence length An index (alphabetical listing) of all the unique words (see next page for a specific format) Style Warnings Issue a warning in the following cases: Word used too often: list each unique word of more than three letters if its usage is more than 5% of the total number of words of more than three letters Sentence length : write a warning message if the average sentence length is greater than 10 Word length : write a warning message if the…arrow_forwardPython only 1. Define printGrid Use def to define printGrid Use any kind of loop Within the definition of printGrid, use any kind of loop in at least one place. Use any kind of loop Within the loop within the definition of printGrid, use any kind of loop in at least one place. it should look like this when called ; printGrid(['abcd','efgh','ijkl']) Prints: a b c d e f g h i j k l 2. Define getColumns Use def to define getColumns Use any kind of loop Within the definition of getColumns, use any kind of loop in at least one place. Use a return statement Within the definition of getColumns, use return _ in at least one place. it should look like this when called ; getColumns(['abcd','efgh','ijkl']) Out[]: ['aei', 'bfj', 'cgk', 'dhl']arrow_forwardC++ program Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage of current population), and the number of days they will multiply. A loop should display the size of the population for each day.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY