Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 1. Download from Drive. Copy the contents of the file to your Cloud Editor. 2. Print out the following for the whole number the
Exercise 1. Download from Drive. Copy the contents of the file to your Cloud Editor. 2. Print out the following for the whole number the user entered: - The result of dividing that number by 3.0 - The remainder when you divide that number by 3 - The number's square root (hint: search the Math reference above for sqrt) - Optional: The result of that number raised to the fourth power (hint: search the Math reference above for pow) 3. Print out the following for the user's full name: - The character at index 0 (see week 2 slides) - The first 3 letters of the users name (hint: substring()) - The length() of the user's name (length is \# of characters including spaces) - Optional: The user's name in ALL CAPS importjava.util.;importjava.lang.Math;publicclassLab2{publicstaticvoidmain(String[]args){Scannerkbd=newScanner(System.in);System.out.print("Pleaseenterawholenumber:");intx=kbd.nextint();kbd.nextiine();//thisisnecessaryforgettingStringinputafteranint(dontworryaboutwhy)System.out.print("Pleaseenteryourfullname:");Stringname=kbd.nextine();//Beneaththiscomment,addyourcodetoprintthevaluesfromTheLab2documentout.}//EndLab2class
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