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...
-
Silla Industries produces 3,000 tables last month. The standard variable manufacturing overhead (MOH) rate used by Silla is $20 per machine hour. Each table requires 0.2 machine hours. Actual machine...
-
Fill in the blank with an appropriate word, phrase, or symbol(s). The apportionment method that satisfies the quota rule but may produce a paradox is called __________ method.
-
The bubble point and dew point curves meet where the mixture turns into (a) Purely two components (b) Purely one component (c) Purely three components (d) None of these.
-
A light truck is purchased on January 1 at a cost of $35,000. It is expected to serve for eight years and have a salvage value of $5,000. Calculate the depreciation expense for the first and third...
-
What is ERD diagram? In what model we develop it? What does it contain? Do we create table in the ERD? Explain.
-
Pool Corporation, Inc., sells swimming pool supplies and equipment. It is a publicly traded corporation that trades on the NASDAQ exchange. The majority of Pools customers are small, family-owned...
-
Svartalfheim manufactures forges. Brokkr&Sindri, maker of fine hammers, had decided to purchase new forges. Eitri, a representative of Svartalfheim, met with Thor, the president of...
-
Venus Inc. ("VI") operates a passenger train service in the country of Galaxy. VI is the sole operator of the train service in Galaxy. However, there is a host of other modes of transportation...
-
The following diagram shows a logic circuit for a 4-bit adder/subtractor that accepts two 8-bit numbers (A7A6 A5A4A3A3AAA and B7 B6 B3 B4B3BBB) and add or subtract them based on the value of Add/Sub...
-
(a) Alice use RSA to send the following message to Bob. 227163 233312 203044 475734 64606 233312 35590 61185 370574 64606 368892 64606 233312 448777. During encryption, Alice the key kipub = (n. e) =...
-
b) A student is asked to use MATLAB to calculate the value of the following expressions for y where c = 2 + x and x = 3: y = x - + 4 C x + 3 2c2 Which of the following sets of MATLAB statements will...
-
3. Consider the following algorithm: 1: procedure INVERT(1) 2 8+A 3: 3: 6: 7: 8: 9: afl while a A do 7+8 84-0 a LINK(3) LINK(3) +- Y end while 1-B 10: 11: end INVERT Let the precondition...
-
Consider the regression equation log = log 2.74 +0.4 log X + 1.19 log X. a. Predict the value of Y when X = 8.8 and X = 4.7. b. Interpret the meaning of the regression coefficients b and b2. a. The...
-
Solve each equation. x 3 - 6x 2 = -8x
-
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.
-
Bisson and Andrew(2007) conducted a meta-analysis of cognitive behavior therapy (CBT) as a treatment for posttraumatic stress disorder (PTSD). They found 14 studies for which they had clinicians...
-
Why might it not make much sense to examine the results for heterogeneity of effects?
-
Use the Bonferroni test from Chapter 16 to elaborate on the results of Exercise 17.4. Exercise 17.4 The interaction in the analysis for Exercise 17.3 suggests that it would be profitable to examine...
Study smarter with the SolutionInn App