public int getPowerUse(){         return super.getPowerUse() + contents * powerRating; //////////////////////////////////////////////// if (args[0].equals("REFRIGERATOR"))         {             String manufacturer = args[1];             String serialNo = args[2];             int basePower = Integer.parseInt(args[3]);             int powerRating =Integer.parseInt(args[4]);             int capacity = Integer.parseInt(args[5]);                          Refrigerator rf=new Refrigerator(manufacturer,serialNo, basePower, powerRating, capacity);             things[rf.getId()]=rf;              returnval = rf.getId();         }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 public int getPowerUse(){
        return super.getPowerUse() + contents * powerRating;

////////////////////////////////////////////////

if (args[0].equals("REFRIGERATOR"))
        {
            String manufacturer = args[1];
            String serialNo = args[2];
            int basePower = Integer.parseInt(args[3]);
            int powerRating =Integer.parseInt(args[4]);
            int capacity = Integer.parseInt(args[5]);
            
            Refrigerator rf=new Refrigerator(manufacturer,serialNo, basePower, powerRating, capacity);
            things[rf.getId()]=rf; 
            returnval = rf.getId();
        }
       

269
270
271 ▾
272
273
274
275
276
277
278
279 ▾
280
281
282 ▾
283
284
285
286
287}
288
public void showAllPower ()
{
}
//Question 6
//Pass case 5 by completing showAllPower ()
System.out.println("-
==SHOWING ALL POWER=
int sumPower =0;
for (int i = 0; i < thingCount; i++)//replace with appropriate code
{
}
== ");
int powerVal-things[i].getPower Use(); //replace with appropriate code
System.out.println(powerVal+"\t"+things[i]);
sumPower+=powerVal;
System.out.println("TOTAL POWER = "+sumPower+"mW");
Transcribed Image Text:269 270 271 ▾ 272 273 274 275 276 277 278 279 ▾ 280 281 282 ▾ 283 284 285 286 287} 288 public void showAllPower () { } //Question 6 //Pass case 5 by completing showAllPower () System.out.println("- ==SHOWING ALL POWER= int sumPower =0; for (int i = 0; i < thingCount; i++)//replace with appropriate code { } == "); int powerVal-things[i].getPower Use(); //replace with appropriate code System.out.println(powerVal+"\t"+things[i]); sumPower+=powerVal; System.out.println("TOTAL POWER = "+sumPower+"mW");
Compile time error
Compile Message
Solution.java:177: error: incompatible types: possible lossy conversion from double to int
return super.getPowerUse() + contents * powerRating;
^
Solution.java:215: error: incompatible types: int cannot be converted to Double
Refrigerator rf=new Refrigerator (manufacturer, serialNo, basePower, power Rating, capacity);
Solution.java:285: error: cannot find symbol
for (int i = 0; i < thingCount; i++)//replace with appropriate code
symbol: variable thingCount
location: class SmartHome
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Exit Status
A
1
Transcribed Image Text:Compile time error Compile Message Solution.java:177: error: incompatible types: possible lossy conversion from double to int return super.getPowerUse() + contents * powerRating; ^ Solution.java:215: error: incompatible types: int cannot be converted to Double Refrigerator rf=new Refrigerator (manufacturer, serialNo, basePower, power Rating, capacity); Solution.java:285: error: cannot find symbol for (int i = 0; i < thingCount; i++)//replace with appropriate code symbol: variable thingCount location: class SmartHome Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 3 errors Exit Status A 1
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education