This website has been a tremendous blessing, and helped me with aprevious task.
ID: 3609971 • Letter: T
Question
This website has been a tremendous blessing, and helped me with aprevious task. I have another problem, and its a little big. In atechnical sense, its actually 2 problems in one. However, you needthe info from the first problem in order to do the second, so Iincluded both. They are both based on the same question in thebook, they are just different ways of going about it, but he needstwo java files for each one. ----Ch04Ex16)
Part 1
You have several pictures of different sizes that you wouldlike to frame. A local picture framing store offers two types offrames- regular and fancy. The frames are available in white andcan be ordered in any color the customer desires. Suppose eachframe is 1 inch wide. The cost of color framing is $.10 per inch.The cost of a regular frame is $.15 per inch and the cost of afancy frame is $.25 per inch. The cost of putting a cardboard paperbehind the picture is $.02 per square inch, and the cost of puttingglass on top of the picture is $.07 per square inch. The customercan also choose to to put crowns on the corners, which costs $.35per crown. Write a program that that prompts the user to input thefollowing information and then output the cost of framing thepicture.
a) The length and the width, in inches, of the picture.
b) The type of the frame.
c) Customer's choice of color to color the frame.
d) If the user wants to put on crowns, and then the number ofcrowns.
----
Part 2 - Revise the picture frame pricing assignment fromchapt 4 to include a Graphical user interface (GUI). A dialog boxthat shows the out put at the same time as you putting in theinput.
Any help on this would be very much appreciate, even if isonly helping with one of the problems. Helping with both definitelymakes you a lifesaver. Thanks guys.
----
Ch04Ex16)
Part 1
You have several pictures of different sizes that you wouldlike to frame. A local picture framing store offers two types offrames- regular and fancy. The frames are available in white andcan be ordered in any color the customer desires. Suppose eachframe is 1 inch wide. The cost of color framing is $.10 per inch.The cost of a regular frame is $.15 per inch and the cost of afancy frame is $.25 per inch. The cost of putting a cardboard paperbehind the picture is $.02 per square inch, and the cost of puttingglass on top of the picture is $.07 per square inch. The customercan also choose to to put crowns on the corners, which costs $.35per crown. Write a program that that prompts the user to input thefollowing information and then output the cost of framing thepicture.
a) The length and the width, in inches, of the picture.
b) The type of the frame.
c) Customer's choice of color to color the frame.
d) If the user wants to put on crowns, and then the number ofcrowns.
----
Part 2 - Revise the picture frame pricing assignment fromchapt 4 to include a Graphical user interface (GUI). A dialog boxthat shows the out put at the same time as you putting in theinput.
Any help on this would be very much appreciate, even if isonly helping with one of the problems. Helping with both definitelymakes you a lifesaver. Thanks guys.
Explanation / Answer
please rate - thanks let me know if any problems, you weren't specific about the formfor the answers import java.util.*; public class Malik4_16 { public static void main(String []args) {String input; double cost,colorcost,framecost,papercost,glasscost,crowncost; char crowns; int numcrowns,type ,color, crown, length, width,area,perimeter; Scanner in=new Scanner(System.in); System.out.print("Enter length of frame: "); length=in.nextInt(); System.out.print("Enter width of frame: "); width=in.nextInt(); System.out.print("Do you want a fancy frame or a regularframe Enter 1 for fancy, 2 for regular: "); type=in.nextInt(); if(type==1) framecost=.25; else framecost=.15; System.out.print("Do you want a white frame or acoloredframe Enter 1 for white, 2 for colored: "); color=in.nextInt(); if(color==2) colorcost=.10; else colorcost=0; System.out.print("Do you want crowns (y/n) "); input=in.next(); crowns=input.charAt(0); if(crowns=='y'||crowns=='Y') {System.out.print("How many crowns?"); crown=in.nextInt(); } else crown=0; if(crown>0) crowncost=crown*.35; else crowncost=0; area=length*width; perimeter=length*2+width*2; papercost=area*.02; glasscost=area*.07; cost=glasscost+papercost+crowncost+colorcost*perimeter+framecost*perimeter; System.out.println("The cost of your frame is: $"+cost); } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.