Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

ra-kas

 
Zabo04's Avatar
  • Answered by:Zabo04
  • Programming Enthusiast
  • Positive Feedback: 100.0 %
  • Accepted Answers: 122
Verified Expert
in Programming

Recent Feedback

Positive
A real life saver, he did the work really fast, and answered any and all of my...
Positive
Wonderful expert!! Thank you!
Positive
great job with the coding. Exactly what I needed
Positive
Simply one of the best and so efficient and accurate. I cannot wait to work...
Positive
Wonderful expert!! I will always use him!!
Positive
So nice professor, Respond very quickly
Positive
great response
Positive
Great Expert
Positive
Wonderful Expert!! Knows his stuff!!
Positive
Very quick and thorough

Customer Question

I am trying to do the following homework but I just cant get it to compile and run
"The Acme computer company sells computers. The price of a computer depends on user-customizable features. The relevant choices are:
§ Processor speed: 4 or 6 GHz
§ Memory: Any amount of memory expressible in 1 GB chunks between 1 and 8 GB
§ Hard Drive: 200 GB, 400 GB, or 600 GB
§ Monitor: 15", 17", or 19" (flat panel)
§ Laptop or desktop
The cost of a computer is determined as follows:
Cost = $50.00 per GHz of processor speed
+ $50.0 per GB of memory
+ $0.40 per GB of hard drive space
+ $1.00 for each square inch of monitor size (assume that a monitor of size n has a height of 0.6n
and a width of 0.8n.)
Add $500 for a laptop. Laptops cannot have 19" screens.
So, for instance, a desktop system with a 4 GHz processor, 1 GB of memory, a 200 GB hard disk, and a 17" monitor would cost (4 * 50 + 1 * 50. + 200 * 0.40 + .6 * 17 * .8 * 17 * 1.00) = $468.72.
If you buy the 6 GHz processor, you must buy at least 2 GB of memory.
Program Specification
Write a program that computes the cost of a user-configurable computer sold by the Acme computer company. The pricing policy is given above. You should ask the user what processor speed, memory size, hard disk size, and monitor size they want, and whether they want a desktop or laptop machine. You should check to be sure that they give a valid value, and end the program with an appropriate message if they do not. If all values are valid, then you should output the price of their computer.
Your program should use JOptionPanes for input and output.
Use at least one switch statement.
It is important that you do defensive checks on the inputs. So report back to the user (and terminate the program) if the user asks for an invalid memory size, or wants too little memory with the 4 GHz processor.
For situations where there are only two choices, it is best to use an "idiot-proof" input method. Use a JOptionPane.showOptionDialog box to ask whether the user wants the standard or upgraded hard drive, processor, and monitor.
"

 

Optional Information:
Computer OS: Windows 7
Browser: IE
Programming Language: java
Compiler: cmd

Already Tried:
import javax.swing.*; public class ComputersPrices { public static void main(String[] args) { Object[] options = {"LabTop", "DeskTop"}; int computer = JOptionPane.showOptionDialog(null, "Select your computer type", "SELECT PC", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, null); boolean Laptop; boolean Desktop; String monitor = JOptionPane.showInputDialog(null, "Enter the Monitor size you desire", "15, 17 or 19"); String hardDrive = JO

Submitted: 448 days and 11 hours ago.
Category: Programming
Value: $45
Status: CLOSED
Picture
Expert:  Zabo04 replied448 days and 7 hours ago.


Zabo04 :

what compiler are you using? Netbeans?

Customer :

Textpad and and eclipse

Zabo04 :

what commands do you run to get your code to compile? I'll admit I do not understand the use of textpad and eclipse when everything can be done graphically within eclipse

Zabo04 :

is there a reason not to use the gui designer?

Customer :

I use them separately. cuz I am not too comfortable with using eclipse yet.

 
Tweet

3 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
Microsoft Visual Basic 2010 Programming Exercise 5/16/2013
I am programming and auto reply macro and Outlook 10 that is 5/16/2013
Hello. I really need help with C Programming. I need a program 5/15/2013
I need to make the submit button bigger 5/15/2013
"For Jatechexpert" Part 1Programming Exercise 2—Calories 5/14/2013
INSTRUCTIONS: VERY IMPORTANT, THIS IS TO BE DONE USING MICROSOFT 5/13/2013
I have a JavaScript programming question. I have a form and 5/13/2013
Need a java programming to fulfill the following requirements: 1. 5/13/2013
I. Overview: Welcome to the CIT216 Practice Final 5/13/2013
Please help with this project https://www.dropbox.com/s/vs 5/12/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

JustAnswer in the News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
71 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan