Answered step by step
Verified Expert Solution
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
CSC Intro to Programming
PreLab
Please write a Java program called PreLab 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 eg 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.nextcharAt; to receive lowercase char
Character.toUpperCaselowerCase 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 doublequote
to print a singlequote
uA 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 :
is Friday
Please enter two numbers for max and min:
The minimum is and the maximum is
Please enter a number to be squarerooted:
The square root of is:
Please enter a base:
Please enter a power:
The base raised to the power of rounded to the nearest whole number, is
Please enter an integer between :
Letter 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started