Write a program that can accept two inputs - a food type and a price, and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that can accept two inputs - a food type and a price, and determines if the food is affordable or expensive. This program should use an if-statement to determine. If the cost of the food is over $20, then the program should say it is expensive, and otherwise it should say it is affordable (this is arbitrary - for the purposes of making this problem simple). Below are a few examples: Enter food: hamburger Enter price: 30 That hamburger is expensive. Enter food: prime rib Enter price: 5 That prime rib is affordable. Write a program that can accept two inputs - a food type and a price, and determines if the food is affordable or expensive. This program should use an if-statement to determine. If the cost of the food is over $20, then the program should say it is expensive, and otherwise it should say it is affordable (this is arbitrary - for the purposes of making this problem simple). Below are a few examples: Enter food: hamburger Enter price: 30 That hamburger is expensive. Enter food: prime rib Enter price: 5 That prime rib is affordable.
Expert Answer:
Answer rating: 100% (QA)
Youve asked for help with writing a program that takes two inputs a type of food and its p... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
You're given the following supply and demand tables: a. What is equilibrium price and quantity in a market system with no interferences? b. If this were a third-party-payer market where the consumer...
-
Let F be a single round of a Feistel cipher operating on 64-bit blocks. That means an input a = (aL, aR) where aL and aR are 32 bits long each, and F(aL, aR) (aR, aL xor f(aR, k)). f is the Feistel...
-
Ivanhoe Company incurred research and development costs of $ 9 0 0 0 0 to develop a patent, and legal fees of $ 3 0 0 0 0 to register the patent. The patent has a legal life of 2 0 years and a useful...
-
Prepare a sensitivity analysis question with an Excel Sensitivity analysis report and answer it. Make sure your question asks about the following a. Optimal solution b. Optimal objective function c....
-
Apply a PESTEL analysis. What impact will health care and biogenerics regulation have on Genentech? Why?
-
Amanda King has just been appointed director of recreation programs for Highland Park, a rapidly growing community in Connecticut. In the past, the city has sponsored a number of softball leagues in...
-
A friend of yours tells you that his parents plan to pay for his college education by selling some family jewelry. Write About It Write a paragraph explaining why you might question this plan.
-
1. Design a switchboard that includes the main information management functions that Mountain High might need. Create a storyboard with a design layout that allows customers to perform the following...
-
Your client just purchased an investment that generates the following cash flows for the next four years. He are able to reinvest these cash flows at 7.2 percent, compounded annually. End of year 1....
-
Fourth-Sixth-Twelfth Bank currently pays an annuall dividend of $1.40 per share. After extensive analysis, you forecast that the Bank's stock will continue to pay the $1.40 dividend for four years....
-
Manufacturing cost data for Martinez Company are presented as follows. Indicate the missing amount for each letter (a) through (i). Direct materials used Case A $65,900 Case B (a) 54,400 44,400...
-
Tao's first bank statement arrived via email. Reconcile the statement with his personal record book (cheque register) to date. CHEQUING ACCOUNT 0471-678 ACCOUNT ACTIVITIES ATM LOCATIONS USED First...
-
The band in the figure below is stainless steel (coefficient of linear expansion = 17.3 10 6 C 1 ; Young's modulus = 18 10 10 N/m 2 ). It is essentially circular with an initial mean radius of 4.6...
-
Long-term space missions require reclamation of the oxygen in the carbon dioxide exhaled by the crew. In one method of reclamation, 1.00 mol of carbon dioxide produces 1.00 mol of oxygen, with 1.00...
-
On April 1, Year 1, Fossil Energy Company purchased an oil producing well at a cash cost of $10,620,000. It is estimated that the oil well contains 820,000 barrels of oil, of which only 720,000 can...
-
A wheelbarrow 1.10 m long has aload of 850. N concentrated 40.0 cm from the axle. a) Find the mechanical advantage of the wheelbarrow. b)What force does Jim need to apply in order to raise this load?...
-
Question ( In the current global economic climate, the Healthcare Cluster Board of Directors is looking to make cost savings across the healthcare facilities. It is proposed that the facilities...
-
What are the principal alloying elements in SAE 4340 steel?
-
Early explorers often estimated altitude by measuring the temperature of boiling water. Use the following two equations to make a table that modem-day hikers could use for the same purpose. p =...
-
Make a 3-D surface plot of the function z = 0.5x2 + 0.5y2 in the domain -2 < x < 2 and -2 < y < 2.
-
When rubber is stretched, its elongation is initially proportional to the applied force, but as it reaches about twice its original length, the force required to stretch the rubber increases rapidly....
-
Convert 3.2117 to fraction form.
-
Calculate \(\frac{12}{25} \times \frac{10}{21}\).
-
1. Calculate \(\frac{4}{21} \div \frac{6}{35}\). 2. Calculate \(\frac{1}{8} \div \frac{5}{28}\).
Study smarter with the SolutionInn App