mp4 CIS 180 Lab 03 Coding through Pseudocode In this lab you are going to create...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
mp4 CIS 180 Lab 03 Coding through Pseudocode In this lab you are going to create a program that will calculate the cost of running an electric device for some period of time. Be sure to read through the instructions COMPLETELY before beginning. Description of the Program: This program will need to obtain the following information from the user: The voltage coming from the outlet (Example: 120 volts and 240 volts are common, but allow them to pick whatever they want). Do not worry about negative values, if they enter it in, that's on them (for now....). The amperage (in amp) that the device uses while on. The cost the utility company charges per kilowatt hour. The number of minutes each day the device is on. The number of days the user would like to project the cost to. (Project sounding like projector) Based on this information program will calculate the following: Wattage/Watts (formula: wattage = amperage * voltage) Kilowatts (convert from watts above, using knowledge of metric system units) Kilowatts used per day (kilowatts* hours per day the device is on) Total Cost per day (Kilowatts used per day * The cost the utility company charges per kilowatt hour) Total Cost During the Projected Period (Total Cost per days * The number of days the user would like to project the cost to) The program should then display these calculate values to the user, remembering that money should only have 2 decimal places. 1. As you did with the previous weeks lab, create a new project (give it an appropriate name like Lab03), and create a new java class (give it an appropriate name like Power Consumption Analyzer). 2. Before you get started coding, create a separate text document called "Lab 03 Pseudocode.txt" (you can do this in Eclipse, or use Notepad). Be sure to include your name, date, and a description of the program. 3. Using your own words, in the best English sentences you can muster, start to outline every step that will lead to the goal. This is akin to the recipe analogy: you need to write down the steps that will bake the cake. The benefit of writing the steps in your own words is that you don't need to get hung up on the coding aspect just yet. Avoid using words like "and" and "then". These words may indicate that you have rolled right into what should be another, separate, step. Example: Bad Step 2: Mix the flour with 2 eggs and stir for 5 minutes, then let sit for 10 minutes. Good Step 2: Mix the flour with 2 eggs. Step 3: Stir for 5 minutes. Step 4: Let sit for 10 minutes. 4. Once you are complete with this document, have the TA look it over to give you the go-ahead to start going with this "Recipe" you have created. Oh, by the way, this is what we call Pseudocode. 5. Before you start coding, copy the pseudocode to your java file and convert them to comments. The name, date, and program description should go at the top of your java files, while all the steps should go inside the main method. 6. Now using these comments as guidelines, you may start coding. Be sure to only code as much as you need to get to a place where you can run and test the program. Incremental progress is important to weed out errors. 7. Use double for all variables except for days, which should use int (we don't want fractional days, only whole days). 8. If you believe you have completed this portion of the lab, have the TA check you off. Once you are checked off for all portions, upload both "Lab 03 Pseudocode.txt" and the .java source code file to myCourses. mp4 CIS 180 Lab 03 Coding through Pseudocode In this lab you are going to create a program that will calculate the cost of running an electric device for some period of time. Be sure to read through the instructions COMPLETELY before beginning. Description of the Program: This program will need to obtain the following information from the user: The voltage coming from the outlet (Example: 120 volts and 240 volts are common, but allow them to pick whatever they want). Do not worry about negative values, if they enter it in, that's on them (for now....). The amperage (in amp) that the device uses while on. The cost the utility company charges per kilowatt hour. The number of minutes each day the device is on. The number of days the user would like to project the cost to. (Project sounding like projector) Based on this information program will calculate the following: Wattage/Watts (formula: wattage = amperage * voltage) Kilowatts (convert from watts above, using knowledge of metric system units) Kilowatts used per day (kilowatts* hours per day the device is on) Total Cost per day (Kilowatts used per day * The cost the utility company charges per kilowatt hour) Total Cost During the Projected Period (Total Cost per days * The number of days the user would like to project the cost to) The program should then display these calculate values to the user, remembering that money should only have 2 decimal places. 1. As you did with the previous weeks lab, create a new project (give it an appropriate name like Lab03), and create a new java class (give it an appropriate name like Power Consumption Analyzer). 2. Before you get started coding, create a separate text document called "Lab 03 Pseudocode.txt" (you can do this in Eclipse, or use Notepad). Be sure to include your name, date, and a description of the program. 3. Using your own words, in the best English sentences you can muster, start to outline every step that will lead to the goal. This is akin to the recipe analogy: you need to write down the steps that will bake the cake. The benefit of writing the steps in your own words is that you don't need to get hung up on the coding aspect just yet. Avoid using words like "and" and "then". These words may indicate that you have rolled right into what should be another, separate, step. Example: Bad Step 2: Mix the flour with 2 eggs and stir for 5 minutes, then let sit for 10 minutes. Good Step 2: Mix the flour with 2 eggs. Step 3: Stir for 5 minutes. Step 4: Let sit for 10 minutes. 4. Once you are complete with this document, have the TA look it over to give you the go-ahead to start going with this "Recipe" you have created. Oh, by the way, this is what we call Pseudocode. 5. Before you start coding, copy the pseudocode to your java file and convert them to comments. The name, date, and program description should go at the top of your java files, while all the steps should go inside the main method. 6. Now using these comments as guidelines, you may start coding. Be sure to only code as much as you need to get to a place where you can run and test the program. Incremental progress is important to weed out errors. 7. Use double for all variables except for days, which should use int (we don't want fractional days, only whole days). 8. If you believe you have completed this portion of the lab, have the TA check you off. Once you are checked off for all portions, upload both "Lab 03 Pseudocode.txt" and the .java source code file to myCourses.
Expert Answer:
Answer rating: 100% (QA)
Heres an example of how the pseudocode for the program could be structured livecodeserver Copy Progr... View the full answer
Related Book For
Modern Systems Analysis And Design
ISBN: 9780134204925
8th Edition
Authors: Joseph Valacich, Joey George
Posted Date:
Students also viewed these programming questions
-
Our primary job's gross income is $3,468.73/month. Deductions are FICA (7.65%), federal tax withholding (11.5%), and state tax withholding (7.8%). How much are your fixed expenses if they are 36% of...
-
The Taylor polynomial for sin(x) for a near 0 to order 5 is 1 1 sin(x) = x - + -x +0(x7) 6 120 The figure below shows a plot of sin(x) [blue] and the above Taylor polynomial [red]. 0.8 0.6 0.4 0.2 1...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
Solve each compound inequality. Graph the solution set, and write it using interval notation. -2x +1> -11 or x+1> 10
-
Assume that Ernesto purchased a laptop computer on July 10 of year 1 for $3,000.In year 1, 80 percent of his computer usage was for his business and 20 percent was for computer gaming with his...
-
The following table gives the probability distribution of a discrete random variable x. Find the following probabilities. a. P(x = 3) b. P(x < 2) c. P(x > 4) d. P(1 < x < 4) e. Probability that x...
-
(Risk and return) Can you think of a risk-based explanation for the following finding? Over the last 40 years, small stocksdefined as shares of firms with a low market valuehad higher returns than...
-
The Blair Companys three assembly plants are located in California, Georgia, and New Jersey. Previously, the company purchased a major subassembly, which becomes part of the final product, from an...
-
Flint Corp. makes and sells deck coating which is sold by the gallon. Two pounds of sand are needed to make one gallon of deck coating. Budgeted production of deck coating for the next two months...
-
Background: A new ownership group has recently purchased ABC Liquors. You have been hired by the new management team to analyze their sales data for the past year and provide them with insights about...
-
Research the company and find information regarding the companys recent performance (i.e., sales, net profit, stock price, new products, etc.) from January 1, 2021 to December 6, 2021. Discuss both...
-
In accounting auditing tax, what term describes the process of verifying and validating financial records and transactions to ensure compliance with tax laws, regulations, and reporting requirements?
-
Title: Veggie Siomai (the wrapper of the siomai is made out from malunggay and pumpkin) Answer the following: What to do: 1. General Market Description 2. SWOT analysis * strength * weakness *...
-
Ann the astronaut weighs 60 kg and pushes a stationary 350 kg satellite while on a space walk. The speed of the satellite is .9 m/s after the push. What is her recoil speed?
-
What is the capital market? What are broker markets? What are dealer markets? How do they differ?
-
Barter corporation has been buying Product BB in lots of 4 800 units. This number is good for four months supply. The cost per unit is P 300 and the cost per order is P 600. The annual carrying cost...
-
The following data pertain to Babor Company for the fiscal year ended December 31: Prior December 31 Current December 31 Purchases of materials $ 170,000 Direct labor 116,500 Indirect labor 46,000...
-
Federated Shipping, a competing overnight delivery service, informs the customer in Problem 65 that they would ship the 5-pound package for $29.95 and the 20-pound package for $59.20. (A) If...
-
Describe several input devices for interacting with a system. Is one device better than all others? Why or why not?
-
In what ways is a request to change an information system handled differently from a request for a new information system?
-
You read in this chapter about the advantages of client/server architectures. What operational and management problems can be created by client/server architectures? Considering both the advantages...
-
Describe the four steps in the closing process. LO15
-
Why are only the statement of financial position accounts permanent? LO17
-
Distinguish between a sunk cost and an opportunity cost. R-2
Study smarter with the SolutionInn App