Hey! I need help with (Code HS: 2.14.5 Amusement Park) public class Amusement Park extends Console Program
Fantastic news! We've Found the answer you've been seeking!
Question:
Hey!
I need help with (Code HS: 2.14.5 Amusement Park)
Transcribed Image Text:
public class Amusement Park extends Console Program { } int AGE LIMIT = 12; int HEIGHT_LIMIT = 48; public void run() { int age read Int("Enter your age: "); int height = readInt("Enter your height in inches: "); boolean oldEnough age >= AGE_LIMIT; boolean tallEnough = height >= HEIGHT_LIMIT; // CHANGE THIS LINE // Convert this boolean expression into its De Morgan equivalent boolean cannotRide = (oldEnough && tallEnough); if(cannotRide) { } else { } System.out.println("You may not ride the rollercoasters."); System.out.println ("You may ride the rollercoasters!"); boolean canSwim = readBoolean("Can you swim? "); boolean hasLifeJacket = readBoolean ("Do you have a life jacket? "); // CHANGE THIS LINE // Convert this boolean expression into its De Morgan equivalent boolean cannot Swim !(canSwim || hasLifeJacket); if (cannotSwim) { } System.out.println("You may not swim in the pool."); } else { System.out.println("You may swim in the pool!"); public class Amusement Park extends Console Program { } int AGE LIMIT = 12; int HEIGHT_LIMIT = 48; public void run() { int age read Int("Enter your age: "); int height = readInt("Enter your height in inches: "); boolean oldEnough age >= AGE_LIMIT; boolean tallEnough = height >= HEIGHT_LIMIT; // CHANGE THIS LINE // Convert this boolean expression into its De Morgan equivalent boolean cannotRide = (oldEnough && tallEnough); if(cannotRide) { } else { } System.out.println("You may not ride the rollercoasters."); System.out.println ("You may ride the rollercoasters!"); boolean canSwim = readBoolean("Can you swim? "); boolean hasLifeJacket = readBoolean ("Do you have a life jacket? "); // CHANGE THIS LINE // Convert this boolean expression into its De Morgan equivalent boolean cannot Swim !(canSwim || hasLifeJacket); if (cannotSwim) { } System.out.println("You may not swim in the pool."); } else { System.out.println("You may swim in the pool!");
Expert Answer:
Answer rating: 100% (QA)
Here are the modified expressions using De Morgans Laws boolean cannotRide oldEnough tallEnough bool... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Data set Theory Assume an informational record with one association parent including matches (a, b) where a can't try not to be a parent of b. (a) Write a Datalog demand which gives the graph of...
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
Violet Flowers expects to sell 3,000 plants a month. She estimated the following monthly costs: Variable Costs $9,000 Fixed Costs $15,000 During her second month of operation, Violet would like to...
-
A firm has an Altman's Z-score of 1.76. What does this mean?
-
Outline the planning process.
-
For Problem 6.8, (a) Fit the corresponding negative binomial model with the same linear predictor. (b) Compare the analysis between part (a) and that from Problem 6.8. 6.8 For the Sexual Health pilot...
-
The following transactions were completed by Simmons Inc., whose fiscal year is the calendar year: 2012 July 1. Issued $64,000,000 of 10-year, 12% callable bonds dated July 1, 2012, at a market...
-
1) John was in Miami, he visited his investment house and invested a total of US$12,000, a fraction at 4% and the remainder at 6%. His total annual return would be $620. How much did he invest at...
-
Unicom is a regulated utility serving Northern Illinois. The following table lists the stock prices and dividends on Unicom from 1989 to 1998. a. Estimate the average annual return you would have...
-
Kelly's Krafters began selling a new product on January 1. Kelly purchased 500 units on January 2 at a cost of $150 and 1500 units on January 5 costing $375. If Kelly uses the weighted average...
-
discuss Fault Tree and Failure Mode Effect Analysis. Describe your understanding of the similarities and differences between these effects and explain your understanding of the potential consequences...
-
historical demand for a product goes as follows: using simple linear regression, calculate the trendline. say the x axis is 1 for april , 2 for many and so on and so on. Calculate a forecast for...
-
4. You are given a relational schema R = ABC, satisfying the following FDs 1. A B 2. AC 3. B C (a) Which normal forms are satisfied? (b) A decomposition into AB and AC is proposed. i. Which normal...
-
Discuss how personal insurance needs are similar or not similarto business needs. Choose and describe an insurance product that can be utilized in your personal life and how it can minimize your...
-
Imagine your client would like to complete a tax inversion, acquiring a foreign company in Switzerland and moving the domicile of the combined company overseas. Your client believes that this will...
-
1.Is Water Vapor an Ideal Gas? 2, The pressure gage on a 2.5 m oxygen tank reads P = 500 kPa 500 kPa. Determine the amount of oxygen in the tank if the temperature is 28 C and the atmospheric V= 2.5...
-
At the beginning of its fiscal year, Lakeside Inc. leased office space to LTT Corporation under a seven-year operating lease agreement. The contract calls for quarterly rent payments of $25,000 each....
-
Write a class that contains the following two methods: /** Convert from Celsius to Fahrenheit */ public static double celsiusToFahrenheit(double celsius) /** Convert from Fahrenheit to Celsius */...
-
Modify the Loan class in Listing 10.2 to throw IllegalArgumentException if the loan amount, interest rate, or number of years is less than or equal to zero. Listing 1 public class Loan { 2 private...
-
Write a program that calculates the energy needed to heat water from an initial temperature to a final temperature. Your program should prompt the user to enter the amount of water in kilograms and...
-
The marginal tax rate on a corporate income of \(\$ 87,000\) is closest to which of the following? a. 15 percent b. 20.5 percent c. 25 percent d. 34 percent
-
Calculate the corporate income tax for each of the following corporate taxable incomes. For each, determine the effective (average) tax rate and the marginal tax rate. a. $12,000 b. $65,000 c....
-
True or False: If the same amount of money is invested in something that can be expensed as in something that must be depreciated (and both provide the same annual returns) then you should choose the...
Study smarter with the SolutionInn App