Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[IN JAVA] Create a Main class and copy the code below into it. Follow the comments in the code to create the output below. End

[IN JAVA] Create a Main class and copy the code below into it. Follow the comments in the code to create the output below. End with a newline. Thanks in advance for the help! The main class is below for you to copy.

Sample Output

Enter two integer values: 12 41 Enter a decimal number: 3.78 Enter name: Mickey Enter initial of last name: M Output 1 Section num1 plus num2: 53 num1 minus num2: -29 num1 times num2: 492 num1 divided by num2: 0 num1 modulous num2: 12 Output 2 Section num1 plus num3: 15.78 num1 minus num3: 8.22 num1 times num3: 45.36 num1 divided by num3: 3.174603174603175 Output 3 Section Mickey M. 

-Main Class-

Edit the code below to create the output above

public class Main { public static void main(String [] args) { // Declare 2 integer variables, called num1 and num2 // Declare a variable that can have a decimal number, call it num3; // Declare a variable to hold a single character, call it let1 // Declare a variable to hold a word, call it word1 // Ask the user to type in two integers and allow the user to type them in - refer to output to see what it should look like // Don't forget to import the class and declare a Scanner object //Ask the user to type in a decimal value and allow the user to type it in - refer to output to see what it should look like // Ask the user to type in their name - and allow the user to type it into the appropriate variable declared // Ask the user to type in their initial of last name - and allow the user to type it into the appropriate variable declared // Note: You will read it in as a string and the use a string method // to get just the first character // Put the statements needed to produce the Output 1 Section System.out.println(" Output 1 Section"); // Put the statements needed to produce the Output 2 Section System.out.println("Output 2 Section"); // Put the statement needed to produce the Output 3 Section System.out.println("Output 3 Section"); } }

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions