Construct UML class diagrams for the Computer and ComputerDriver classes in Exercise 6. Exercise 6 Given this
Question:
Construct UML class diagrams for the Computer and ComputerDriver classes in Exercise 6.
Exercise 6
Given this Computer design program:
Use the following trace setup to trace the Computer program. Note that we have used abbreviations to keep the trace setup’s width as small as possible. Don’t forget to specify default and initial values, even if they don’t affect the final result.
Transcribed Image Text:
1 2 3 *Dean & Dean 4 5 *This exercises the Computer class. ***** 6 7 8 9 ( 10 11 12 3 4 5 6 7 /********* * Computer Driver.java 8 9 * public class Computer Driver 13 14 15 16 17 18 19) end class Computer Driver 1 /********** 2 19 20 21 22 23 24 public static void main(String[] args) ( Computer my Pc new Computer (); myPc.assignProcessor (); my Pc.assignRamSize(): my Pc.assignDiskSize(); my Pc.calculateCost (); my Pc.print Specification(); 3 // end main * Computer.java Dean & Dean. * 31 32 10 public class Computer 11 ( * This class collects specifications for a Computer. ***** 12 private String processor: 13 14 15 16 17 18 import java.util.Scanner: - private long ramSize (long) 1000000000.0; private long diskSize: private double cost; //****** public void assignProcessor () ( Scanner stdIn - new Scanner (System.in); this.processor = stdIn.nextLine(); } // end assignProcessor 25 26 27 public void assignRamSize() 28 ( 29 30 this.ramSize = (long) 3000000000.0; 3 // end assignRamSize //***** 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 public void printSpecification () 60 ( 61 62 63 64 65 66 // end class Computer public void assignDiskSize() { Scanner stdIn = new Scanner (System.in); long diskSize; diskSize = stdIn.nextLong(); } // end assignDiskSize //************** public void calculate Cost() ( this.cost = this.ramSize / 20000000.0 + this disksize / 200000000.0; if (this.processor. equals("Intel")). ( this.cost += 200; } else ( this.cost + 150; } } // end calculate Cost //******** **/ } // end print Specification *********** **************************** ********* System.out.println("Processor = " + this.processor); System.out.println("RAM = " + this.ramSize); System.out.println("Hard disk size = "+ this.diskSize); System.out.println("Cost = $" + this.cost);
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (3 reviews)
1 Input Values Processor Intel RAM Size 80000000000 2 Driver main myPc is ins...View the full answer
Answered By
JAPHETH KOGEI
Hi there. I'm here to assist you to score the highest marks on your assignments and homework. My areas of specialisation are:
Auditing, Financial Accounting, Macroeconomics, Monetary-economics, Business-administration, Advanced-accounting, Corporate Finance, Professional-accounting-ethics, Corporate governance, Financial-risk-analysis, Financial-budgeting, Corporate-social-responsibility, Statistics, Business management, logic, Critical thinking,
So, I look forward to helping you solve your academic problem.
I enjoy teaching and tutoring university and high school students. During my free time, I also read books on motivation, leadership, comedy, emotional intelligence, critical thinking, nature, human nature, innovation, persuasion, performance, negotiations, goals, power, time management, wealth, debates, sales, and finance. Additionally, I am a panellist on an FM radio program on Sunday mornings where we discuss current affairs.
I travel three times a year either to the USA, Europe and around Africa.
As a university student in the USA, I enjoyed interacting with people from different cultures and ethnic groups. Together with friends, we travelled widely in the USA and in Europe (UK, France, Denmark, Germany, Turkey, etc).
So, I look forward to tutoring you. I believe that it will be exciting to meet them.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Question Posted:
Students also viewed these Computer science questions
-
Given this Computer design program: Use the following trace setup to trace the Computer program. Note that we have used abbreviations to keep the trace setups width as small as possible. Dont forget...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Example Problem for Declining Balance Depreciation Methods Historical cost of equipment A: $120,000, purchased on January 1, 2014. Estimated salvage value: $20,000; Estimated useful life: 5 years....
-
In Figure, suppose Br2 adds to the alkene from the bottom, rather than from the top as shown. Analyze the stereochemistry of the reaction in this case and explain which products areformed. Relative...
-
The following data represent the running times of films produced by 2 motion-picture companies. Test the hypothesis that the average running time of films produced by company 2 exceeds the average...
-
An object of irregular shape has a characteristic length of \(L=0.5 \mathrm{~m}\) and is maintained at a uniform surface temperature of \(T_{s}=400 \mathrm{~K}\). When placed in atmospheric air at a...
-
An intangible asset cost $300,000 on January 1, 2011. On January 1, 2012, the asset was evaluated to determine whether it was impaired. As of January 1, 2012, the asset was expected to generate...
-
A company has just announced a dividend of $0.80 for this year and $0.835 for the next year. Dividends are expected to grow at a constant rate indefinitely. What is the current stock price if the...
-
When a methods execution terminates, its local variable values become garbage. (T / F)
-
What does UML mean? That is, what words do its initials represent?
-
If X 1 is the mean of a random sample of size n from a normal population with the mean and the variance 2 1 , X 2 is the mean of a random sample of size n from a normal population with the mean ...
-
A study found that professors tend to give higher grades to students who take more than one course from the professor than to students who take only one course from the professor, suggesting that...
-
What are the general rules for measuring and recognizing an impairment of a receivable?
-
What is the role of risks and rewards when accounting for a transfer of receivables?
-
Under what conditions should an item be recognized in the financial statements?
-
What is monitoring cost and how does it affect the firms choice of capital structure?
-
Suppose that you are installing a new room reservation system for your university that tracks which courses are assigned to which rooms. Assume that all the rooms in each building are "owned" by one...
-
Outline some of the major problems confronting an international advertiser.
-
Return to the ABC data in Short Exercise S13-12. ABC had 8,000 shares of common stock outstanding during 2018. ABC declared and paid preferred dividends of $4,000 during 2018. Show how ABC reports...
-
Some experts argue that object-oriented techniques are simpler for novices to understand and use than are DFDs and ERDs. Do you agree? Why or why not?
-
The car travels along the curve having a radius of R. If its speed is uniformly increased from v 1 to v 2 in time t, determine the magnitude of its acceleration at the instant its speed is v 3 ....
-
Briefly describe a derivative security. What is a futures contract? What is an option contract? Indicate the difference between a call option and a put option Option.
-
Why does Bernice have a decrease in arterial Po 2 (Pa co2 )? Why is her percent O 2 saturation decreased, and what are the implications for O 2 delivery to the tissues? Why are Bernices nail beds...
-
What kind of synergies revenue or cost have the best chance of being realized? Explain
Study smarter with the SolutionInn App