Concept explainers
Land Calculation
In the United States, land is often measured in square feet. In many other countries, it is measured in square meters. One acre of land is equivalent to 43,560 square feet. A square meter is equivalent to 10.7639 square feet. Write a
Hint: Because a square meter is larger than a square foot, there will be fewer square meters in
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
SURVEY OF OPERATING SYSTEMS
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Database Concepts (8th Edition)
Degarmo's Materials And Processes In Manufacturing
- A county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. If an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 75¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $45. Write a program that asks for the actual value of a piece of property and displays the assessment value and property tax.arrow_forwardBody Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program which prompts the user to enter the weight in kgs (integer value) and height in feet and inches (both integers) and then calculates the BMI of the person. Your program first need to convert inches to meters (i.e. inches * 0.0254) and then use the following formula to calculate BMI: weight kilogram / (height_meter)^2 Your program displays the BMI value in two decimal places and the corresponding status as shown in the examples below. Note that one inch is 0.0254 meters and 1 foot is 12 inches. For example: Input Result 62 5 10 89 6 0 45 BMI BMI < 18.5 18.5 s BMI < 25.0 25.0 ≤ BMI < 30.0 30.0 ≤ BMI 7 82 5 Interpretation Underweight Normal Overweight Obese 2 Enter weight (kg): Enter height (feet): Enter height (inches): BMI is 19.61, Normal Enter weight (kg): Enter height (feet): Enter height (inches): BMI is…arrow_forwardGuess-the-number-game: Write a program that pays the game of “guess the number” as follows: Your program choose the number to be guess by selecting an integer at random in the range 1 to 1000. The program then displays the following: I have a number between 1 and 1000. Can you guess my number? Please type your first guess. The player then type a first guess. The program responds with one of the following: 1. Excellent ! you guessed the number! Would like to play again (y or n)? 2. Too low. Try again. 3. Too high. Try again. If the payer’s guess is incorrect, your program should loop until the player finally get the number right. Your program should keep telling the player Too high or Too low to help the player “zero in” on the correct answer.arrow_forward
- You arrive in front of a bridge that you must cross to reach a village before dark. Crossing the bridge is not free - the bridgekeeper asks you to roll two dice to determine the cost. You decide to write a program to verify that he is charging the right price. Your program should read two integers, between 1 and 6, representing the values of each die. If the sum is greater than or equal to 10, then you must pay a special fee (36 coins). Otherwise, you pay twice the sum of the values of the two dice. Your program must then display the text "Special tax" or "Regular tax" followed by the amount you have to pay on the next line.arrow_forwardAlyssa is very particular about what she gets for dinner. The more hungry she is, the more she can not figure out what to eat! Write a short program that asks a few questions and then makes the correct suggestion based on the following rules: Alyssa considers any temperature below 50 to be cold and anything 50 and above to be warm. If it is cold and raining, Alyssa wants to have soup. If none of these rules apply, Alyssa will always have meatballs. Alyssa has to eat before class starts! When it is 15 minutes or less until class, she gets a sandwich. This is the most important rule. Your program should prompt the user with the following. Enter temperature (0 to 100): Enter weather (sunny, raining): Enter minutes until class starts (0 to 60): Below is sample input to test your program. 40 raining 30 Your program should output the following. soup Code Skeleton: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new…arrow_forwardBody mass index (BMI) is a measure of health based on weight. It can be calculated by taking your weight in kilograms and dividing it by the square of your height in meters. Write a program that prompts the user to enter a weight in pounds and height in inches and displays the BMI. Note that one pound is 0.45359237 kilograms and one inch is 0.0254 meters.arrow_forward
- One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract. Hint: Divide the amount entered by 43,560 to get the number of acres.arrow_forwardsolve using paython language and take screenshot contains the codearrow_forwardNote: write a Jave Progame below Question2: Suppose a retail business sells an item that is regularly priced at $98 and is planning to have a sale where the item s price will he reduced by 25 percent. You have been asked to write a program to calculate the sale price of the item. To determine the sale price you perform two calculations: you get the amount of the discount, which is 25 percent of the item's regular price. you subtract the discount amount from the item's regular price. This gives you the sale price.arrow_forward
- f. A laborant in a laboratory does a number of antigen tests in one day. Write a program that simulates the number of antigen tests done in a day in a laboratory, displays the number of positives and negatives, and calculates the % of positives in one day. Your program needs to first generate a random number that will show the number of tests done in a day. One laboratory in a day cannot do more than 100 tests and less than 1 (they do at least one). Then for each of the tests, your program needs to generate a random number to show whether they are positive or negative. In order to write this program, you need to have the following three functions used by the main function: test result (void): This function generates a test result. It should randomly return either one or zero. 1 means positive test result and 0 means negative test result. float positive percentage (int,int) : This function takes the total number of positives and the total number of tests and returns the % of positives.…arrow_forwardGiven an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula: length = v2/2a Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared and displays the minimum runway length.arrow_forwardWrite a program that asks for the number of calories and fat grams in a food. The program should display the percentage of calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating that the food is low in fat. One gram of fat has 9 calories, so Calories from fat = fat grams * 9. The percentage of calories from fat can be calculated as Calories from fat ÷ total calories . Input Validation: Make sure the number of calories and fat grams are not less than 0. Also, the number of calories from fat cannot be greater than the total number of calories. If that happens, display an error message indicating that either the calories or fat grams were incorrectly entered.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning