Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

please write in Java! shouldnt be too much code just looks like a lot of instructions, if done in Java correctly will thumbs up! Directions:

image text in transcribed

image text in transcribed

please write in Java! shouldnt be too much code just looks like a lot of instructions, if done in Java correctly will thumbs up!

Directions: complete all steps below and show your instructor for credit. 1. Write a prompt that asks a user for their age. Write a ... one-way if ...statement with a condition that checks if the age is less than eighteen. If so, display the age. 2. Based on the user's age, write a ...two-way if ... statement with a condition that checks to see if an age is greater than eighteen. Display statements for both the TRUE and FALSE return cases. 3. Write a ... nested if ... statement that checks to see if the age is greater than 40 for condition 1. For the second condition, the nested if statement checks to see if the age is less than 6o. Write an output statement if the second condition returns true, i.e., you are middle aged! Display results to the Console. 4. Write a ...multi-branch if.. statement with the following conditions and statements, use your LOGIC operators in the conditional statements! Make sure to use a default else case. - For ages 1-18, output: Being agile and spry, your age is: - For ages 19-40, output: It's great to be alive! Your age is: - For ages 41-65, output: Go crazy you can still move! Your age is: " For ages 65 and up, output: Retirement is golden! Your age is: 5. Write a ...switch statement... that checks for the same cases as in the previous step for ages and output statements. Make sure to use a default case. 6. Write an ... if statement ... to determine if the following a discount fee should be applied to a purchase of a phone. Determine if the price of the phone is between 400 and 500 ? If 50, apply the discount to the overall price. Display the price or total purchase to the Console. Use an if statement with ONE condition that contains TWO expressions with a LOGICAL AND operator. // start with value, but change values to test your logic! double phone =559.00; double discount =.03; 7. Write code to prompt the user to enter their favorite number. Write an if condition and code block to determine if the user's favorite number (prompt) is over 5 OR less than 10 ? Use an if statement with ONE condition that contains TWO expressions with a LOGICAL OR operator. Display the results to the Console

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students explore these related Databases questions

Question

Consider this article:...

Answered: 3 weeks ago