Question: JAVA BY THE WAY Asg 2 Part 2 - a) Write a complete program whose class name is Asg2Prt2. b) We need to write a

JAVA BY THE WAY

Asg 2 Part 2 - a) Write a complete program whose class name is Asg2Prt2. b) We need to write a program that will calculate the average monthly sales data for a small company. c) Declare an integer constant, MONTHS_IN_YEAR, whose value is 12. d) Calculate the average monthly sales if the annual sales are equal to 112,345,734.89. Make sure the result is stored as a double. e) Print the result of the calculated average monthly sales using the following text: "Average Monthly Sales: " calculated value of average monthly sales f) Make sure the output statement is readable and looks nice. g) Include appropriate comments in your program.

Asg 2 Part 3 - a) Write a complete program whose class name is Asg2Prt3. b) Create a String variable address and a String variable urlBegin that has a value of "http://". c) Write a String expression consisting of the urlBegin variable concatenated with the address variable String value. So, if the variable refers to "www.stedwards.edu", the value of the expression would be "http://www.stedwards.edu". d) Assign the value of "www.stedwards.edu" to the variable address. e) Print the result of the concatenated string and nothing else. f) Make sure the output statement is readable and looks nice. g) Include appropriate comments in your program.

Asg 2 Part 4 - a) Write a complete program whose class name is Asg2Prt4. b) import java.util.Scanner c) Create a scanner class and statement that will accept inputs from the keyboard d) Create a statement that will accept a customer's name from the keyboard as a string Enter your name: e) Create a statement that will accept a customer's age from the keyboard as an int Enter your age: f) Create a statement that will accept a customer's check amount from the keyboard as a double Enter your check amount: g) Print the values accepted from the keyboard using the following text: "Welcome: " customerName "At your next birthday you will be age: " custAge + 1 "Thank you for your purchase amount of: " custCheckAmount h) Print each statement on a separate line i) Make sure the output statement is readable and looks nice. j) Include appropriate comments in your program. k) hint make sure that clear the keyboard end of line character with keyboardInput.nextLine(); // this removes the enter key from reading the double value like you did on lab 1

Asg 2 Part 5 - a) Write a complete program whose class name is Asg2Prt5. b) Repeat Part 4 using JOption Dialog boxes c) Import javax.swing.JOptionPane; d) Create a JOptionPane that will accept a customer's name from the keyboard as a string through a dialog panel Enter your name: e) Create a JOptionPane that will accept a customer's age from the keyboard as an int through a dialog panel Enter your age: f) Create a JOptionPane that will accept a customer's check amount from the keyboard as a double through a dialog panel Enter your check amount: g) Print the values accepted from the keyboard using the following text: "Welcome: " customerName "At your next birthday you will be age: " custAge + 1 "Thank you for your purchase amount of: " custCheckAmount h) Print each statement on a separate line i) Make sure the output statement is readable and looks nice. j) Include appropriate comments in your program.

4. Upload to Canvas in a single text file, asg2.txt, containing ALL of the following:

Your name and assignment number at the top of the text file. Captured console output and all Java code from each section above, all neatly copied into the text file, Asg2-yourSEUusername.txt.

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!