Write a program that asks the user some questions in order to determine if it is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that asks the user some questions in order to determine if it is safe for them to ride on the rollercoaster. It is unsafe for people under 110 cm tall and for pregnant women. The program has to ask for the user's height and gender. If they are female, then they are asked if they are pregnant. The program then outputs whether they are allowed to ride the rollercoaster or not. An appropriate error message should be displayed if any negative number is entered as input. The program should continue until user enters "Quit" as input Example Runs Run1 Last Name? Smith Height (cm)? 120 Gender(Male/Female)? Male You are allowed to ride. Run2 Last Name? Smith Height (cm)?100 You are not allowed to ride. Run4 Last Name? Rose Height (cm)? 160 Gender(Male/Female)a? Female Pregnant(Yes/No)? Yes You are not allowed to ride. Run5 Last Name? Smith Height (cm)?-110 ERROR! Enter correct height. Runs Run3 Last Name? Rose Height (cm)? 130 Gender(Male/Female)? Female Pregnant (Yes/No)? No You are allowed to ride. Last Name? Quit Bye, bye! Write a program that asks the user some questions in order to determine if it is safe for them to ride on the rollercoaster. It is unsafe for people under 110 cm tall and for pregnant women. The program has to ask for the user's height and gender. If they are female, then they are asked if they are pregnant. The program then outputs whether they are allowed to ride the rollercoaster or not. An appropriate error message should be displayed if any negative number is entered as input. The program should continue until user enters "Quit" as input Example Runs Run1 Last Name? Smith Height (cm)? 120 Gender(Male/Female)? Male You are allowed to ride. Run2 Last Name? Smith Height (cm)?100 You are not allowed to ride. Run4 Last Name? Rose Height (cm)? 160 Gender(Male/Female)a? Female Pregnant(Yes/No)? Yes You are not allowed to ride. Run5 Last Name? Smith Height (cm)?-110 ERROR! Enter correct height. Runs Run3 Last Name? Rose Height (cm)? 130 Gender(Male/Female)? Female Pregnant (Yes/No)? No You are allowed to ride. Last Name? Quit Bye, bye!
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
This question concerns lexical grammars. (a) Tree Adjoining Grammars contain two types of elementary tree. (i) What are these trees called? [1 mark] (ii) If one were building a grammar for English...
-
A regular language is a language that can be defined by a regular expression. 0 2 . 1 Complete the unshaded cells of Table 1 to show which of the statements about regular languages are true and which...
-
The global survey we learned about in Exercise 49 also asked respondents how they felt about the statement "I try to avoid eating fast foods." The random sample of 800 included 411 people 35 years...
-
Miracle Industries produces high-end flutes for professional musicians across the globe. Actual fixed manufacturing overhead for the year was $1,200,000, while the budgeted fixed manufacturing...
-
Multiply in the indicated base. 1112 x 1012
-
If you had been treated with respect, this would never have happened, would it?
-
Lasting Impressions (LI) Company is a medium-sized commercial printer of promotional advertising brochures, booklets, and other direct-mail pieces. The firm's major clients are ad agencies based in...
-
produce a reflective comparison of China and the U.S. in terms of social/political/economic systems. Given the focus of this course and this particular module, what is the fundamental basis for the...
-
Felix Pharmaceuticals Inc. is a diagnostic company. They are a small start-up and have some promising developments for covid-19 diagnostic tools. They have just completed their accounts for December...
-
Does product quality influence what you purchase? Do you believe that good quality equals customer satisfaction?
-
How did the cognitive dissonance make you feel? Why? How did you resolve the dissonance? Did you change your attitude, change your behavior, add new cognitions, or something else? Did you use...
-
After reading the Texas Board of Nursing "Delegation Packet, describe a situation that can occur in a work setting, or that could potentially occur, that demonstrates the importance of following the...
-
Do you believe compensation should be confidential? Should all position compensations be confidential, or only select positions (for example, should the average employees compensation be...
-
How does trust develop within advanced teams, and how does it impact team dynamics and performance ?
-
Sulfuric acid is commonly used as an electrolyte in car batteries. Suppose you spill some on your garage floor. Before cleaning it up, you wisely decide to neutralize it with sodium bicarbonate...
-
For a nonzero constant a, find the intercepts of the graph of (x 2 + y 2 ) 2 = a 2 (x 2 - y 2 ). Then test for symmetry with respect to the x-axis, the y-axis, and the origin.
-
Type in and run the following program. Then modify it to show a different greeting and image. import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JOptionPane; public class Test {...
-
In Exercise P3.13 you were asked to write a program to convert a number to its representation in Roman numerals. At the time, you did not know how to eliminate duplicate code, and as a consequence...
-
You can read the itemCount instance variable of the CashRegister class with the getCount accessor method. Should there be a setCount mutator method to change it? Explain why or why not.
-
James Madison, the fourth President of the United States, was 163 cm tall. His height converts to the z score of -2.28 when included among the heights of all presidents. Is his height above or below...
-
Which do you think has less variation: the IQ scores of students in your statistics class or the IQ scores of a simple random sample taken from the general population? Why?
-
Carbon monoxide is measured in San Francisco on five different days, and the mean of those five values is 0.62 parts per million. Four of the values (in parts per million) are 0.3, 0.4, 1.1, and 0.7....
Study smarter with the SolutionInn App