Question: 14. I Prog 1: Input & Output (1) Input one integer and output the input, the squared, and cubed. (2 pts) Enter Integer: You entered:

 14. I Prog 1: Input & Output (1) Input one integer
and output the input, the squared, and cubed. (2 pts) Enter Integer:
You entered: 4 4 squared is 16 4 cubed is 64 (2)
Input a real number and converter the real number to integer, the
output boht numbers (2 pts) Enter real number: 5.89 You entered: 5.89

14. I Prog 1: Input & Output (1) Input one integer and output the input, the squared, and cubed. (2 pts) Enter Integer: You entered: 4 4 squared is 16 4 cubed is 64 (2) Input a real number and converter the real number to integer, the output boht numbers (2 pts) Enter real number: 5.89 You entered: 5.89 whole number of 5.89 is 5 (3) Input and output String using next() method(2 pts) Enter statement Great Semester! You entered: Great Sementer! (3) Input and output String using nextLine() method(2 pts) Enter statement I love programming! You entered: I love programming! (4) Prompt the user to input a character and output the character and ASCII of the character (2 pts) Enter character You entered: a ASCII number of is 97 ACTIVITY 14.1.1: Prog 1: Input & Output 4110 U Prog1_InputOutput.java Load default template 3 input and output different data types 7 Import java.util.; 10 public class Progl_Input output 12 public static void main(String[] ang) library > ENGR 204: Intro to Object Oriented Progr home > 14.1: Prog 1: Input & Ou 5 previous submissions 6:31 PM on 1/20/20 View 5:10 PM on 1/20/20 View 2/10 0/10 4/10 4/10 View v 1:39 PM on 1/19/20 1:27 PM on 1/19/20 Hide A Prog1_InputOutput.jav import java.util."; 10 public class Progl_InputOutput public static void main(String[] arg) { int numi; double reali; String stri,str2, str 3; charch; Scanner se = new Scanner(System.in); System.out.println("Enter integer: "); nunt . sc.nextInt(); System.out.println(" you entered: nul); System.out.println(nunte squared isinuminum) System.out.println(num. cubed is nu nunt ); Only show failing tests 1: Compare output A 5,89 search 1) Prtsen 08 vious submissions PM on 1/20/20 View PM on 1/20/20 PM on 1/19/20 PM on 1/19/20 2/10 0/10 4/10 View View 4/10 Hide A Prog1_InputOutput.java System.out.println("Enter real number:"); reall sc.nextDouble(); System.out.println(" You entered: "+reali); System.out.println("whole number of "+realit" is "+(int)reali); System.out.println("Enter statement"); strl .next str2 sc.next(): System.out.println(" you entered:"); System.out.println(stri); System.out.println(str2); Sc.nextLine(); System.out.println("Enter statement"); str3 = sc.nextLine(); System.out.println(" you entered: "+str); Only show failing tests Compare output 5.89 PrtScn 0/10 View PM on 1/20/20 PM on 1/19/20 PM on 1/19/20 4/10 View 4/10 Hide ~ Prog1_Inputou System.out.printin(stri); System.out.println(str2); sc.nextLine(); System.out.println("Enter statement"); str3 - sc.nextLine(); system.out.println(" you entered: "+str3); System.out.println("Enter character"); ch - sc.next().charAt(0); System.out.println(" you entered: "+ch); System.out.println("ASCII number of a is "+(int)ch); Only show failing tests 1: Compare output 5.89 46 14. I Prog 1: Input & Output (1) Input one integer and output the input, the squared, and cubed. (2 pts) Enter Integer: You entered: 4 4 squared is 16 4 cubed is 64 (2) Input a real number and converter the real number to integer, the output boht numbers (2 pts) Enter real number: 5.89 You entered: 5.89 whole number of 5.89 is 5 (3) Input and output String using next() method(2 pts) Enter statement Great Semester! You entered: Great Sementer! (3) Input and output String using nextLine() method(2 pts) Enter statement I love programming! You entered: I love programming! (4) Prompt the user to input a character and output the character and ASCII of the character (2 pts) Enter character You entered: a ASCII number of is 97 ACTIVITY 14.1.1: Prog 1: Input & Output 4110 U Prog1_InputOutput.java Load default template 3 input and output different data types 7 Import java.util.; 10 public class Progl_Input output 12 public static void main(String[] ang) library > ENGR 204: Intro to Object Oriented Progr home > 14.1: Prog 1: Input & Ou 5 previous submissions 6:31 PM on 1/20/20 View 5:10 PM on 1/20/20 View 2/10 0/10 4/10 4/10 View v 1:39 PM on 1/19/20 1:27 PM on 1/19/20 Hide A Prog1_InputOutput.jav import java.util."; 10 public class Progl_InputOutput public static void main(String[] arg) { int numi; double reali; String stri,str2, str 3; charch; Scanner se = new Scanner(System.in); System.out.println("Enter integer: "); nunt . sc.nextInt(); System.out.println(" you entered: nul); System.out.println(nunte squared isinuminum) System.out.println(num. cubed is nu nunt ); Only show failing tests 1: Compare output A 5,89 search 1) Prtsen 08 vious submissions PM on 1/20/20 View PM on 1/20/20 PM on 1/19/20 PM on 1/19/20 2/10 0/10 4/10 View View 4/10 Hide A Prog1_InputOutput.java System.out.println("Enter real number:"); reall sc.nextDouble(); System.out.println(" You entered: "+reali); System.out.println("whole number of "+realit" is "+(int)reali); System.out.println("Enter statement"); strl .next str2 sc.next(): System.out.println(" you entered:"); System.out.println(stri); System.out.println(str2); Sc.nextLine(); System.out.println("Enter statement"); str3 = sc.nextLine(); System.out.println(" you entered: "+str); Only show failing tests Compare output 5.89 PrtScn 0/10 View PM on 1/20/20 PM on 1/19/20 PM on 1/19/20 4/10 View 4/10 Hide ~ Prog1_Inputou System.out.printin(stri); System.out.println(str2); sc.nextLine(); System.out.println("Enter statement"); str3 - sc.nextLine(); system.out.println(" you entered: "+str3); System.out.println("Enter character"); ch - sc.next().charAt(0); System.out.println(" you entered: "+ch); System.out.println("ASCII number of a is "+(int)ch); Only show failing tests 1: Compare output 5.89 46

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!