Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC 1 2 0 1 - Intro to Programming 0 2 / 1 9 / 2 0 2 4 PreLab 0 4 Please write a

CSC1201- Intro to Programming 02/19/2024
PreLab04
Please write a Java program called PreLab04 that performs the following. You must use the following for your
input and output:
Scanner input
o Use nextInt() for any integer input requested
o Use nextDouble() for any number input requested
o Use next() for any String input (e.g. last name)
Switch statement for day of the week
Math.min()
Math.max()
Math.sqrt()
Math.pow()
Math.round()
Casting int to char for alphabetic index
char lowerCase = input.next().charAt(0); to receive lowercase char
Character.toUpperCase(lowerCase) to flip lowercase to uppercase
String lastName = input.next(); to obtain a string from the console
for a new line
\t to tab over
\ to print a double-quote
\ to print a single-quote
\u263A to print a smiley face
Heres a sample run. Your output should be formatted exactly as below:
run:
Please enter an integer for the day of the week (0-6): 5
5 is Friday
Please enter two numbers for max and min:
53.1
The minimum is 3.1 and the maximum is 5.0
Please enter a number to be square-rooted:
25.1
The square root of 25.1 is: 5.0099900199501395
Please enter a base:
3
Please enter a power:
4.1
The base 3.0 raised to the power of 4.1, rounded to the nearest whole number, is 90
Please enter an integer between 1-26:
3
Letter 3 is: c
Please enter a lower case character:
e
Letter in uppercase is E
Please enter your last name:
Cassidy
Please enter an adjective for Java:
awesome
Here's my quote:
"Programming is 'awesome' for those that work hard." - Cassidy

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

(1 point) Calculate 3 sin x cos x dx.

Answered: 1 week ago

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

The company has fair promotion/advancement policies.

Answered: 1 week ago