(Solved) : Users Keep Track Robot Inventory First Design Robot Class Build Application Creates Robot Q37267033 . . .



users to keep track of robot inventory. First, you will design a Robot class, and then build an application that creates Robot objects. Important formulas / relationships: Before we begin designing robots, we should understand a few key electrical terms and relationships Terms: Voltage (V) – The electrical potential between two points, measured in volts Current (l) – The flow of electrons through a material, measured in amps Resistance (R) – A measure of the restriction of current flow through a material, measured in ohms. Current – Voltage / Resistance Power (P) – The measure of electrical energy over time, measured in watts. Power Voltage *Current Watt-Hours (Wh) – A Measure of how much power could be supplied in 1 hour. A typical AA battery has a voltage of 1.5 Volts, and a supply of 3.75 Watt-Hours. This means a AA battery could supply 3.75 Watts of power for 1 hour, or 7.5 Watts of power for 30 minutes. Power supply length ( in hoursTotal Watt-Hours/ Power Summary Time Wh/P 1 AA Battery 1.5 Volts, 3.75 Wh Robot Class Details: Add a Robot class to your project. Include all fields, properties, methods and constructors to properly build a Robot object with the following attributes and behaviors: Attributes ID (string value) must be a length of 4 or 5 characters Number of AA Batteries (int value) – must be between 2 and 6 . Resistance (double value) can be any value greater than 0 Behaviors: GetPower) returns the power, in Watts, of this robot. GetRunTime() – returns how long this robot will run, given its number of batteries (!) Remember — each AA battery can produce 3.75 Watt-Hours of energy Summary() prints the ID, Number of Batteries, Power, and RunTime values of this robot NOTE: Protect your class against invalid values! Main() Program Details: In Main(), create a program that allows the user to to enter in robot information for a number of robots, and then calculates and prints a robot summary report. Prompt the user to enter in the number of robots they wish to build. . For each robot, Prompt for the robot’s ID, Number of AA Batteries, and Resistance After all robots have been entered, output the following: o How many total batteries are required for all the robots entered? o What is the average Power of all robots entered? o Which Robot ID has the longest runtime? o Print the Summary for all robots entered. Hint: Use object’s built from the Robot class to solve these problems! . Example output iRobot Factory (PA6) The Robot Factor ow many robots shall we build: 3 Enter Robot 1 ID: R2D2 Enter Robot 1 batteries: 3 Enter Robot 1 resistance: 550 Enter Robot 2 ID: Astro Enter Robot 2 batteries: kitten Invalid number. Try again: 5 Enter Robot 2 resistance: puppy Invalid number. Try again: 33.3 Enter Robot 3 ID: TooLong Enter Robot 3 batteries: 18 Enter Robot 3 resistance: -100 “Default ID set to “XX-XX”* *Default Batteies set to 2 *Default Resistance set to 100* otal Batteries required: 10 verage power of all robots: 0.61 obot R2D2 has longest runtime at 305.56 hours. obot Summary: 2D2: 3 Batteries 0.04 Watts (305.56 hours runtime) stro 5 Batteries 1.69 Watts (11.10 hours runtime) XX2 Batteries 0.09 Watts (83.33 hours runtime) ress any key to exit… Show transcribed image text users to keep track of robot inventory. First, you will design a Robot class, and then build an application that creates Robot objects. Important formulas / relationships: Before we begin designing robots, we should understand a few key electrical terms and relationships Terms: Voltage (V) – The electrical potential between two points, measured in volts Current (l) – The flow of electrons through a material, measured in amps Resistance (R) – A measure of the restriction of current flow through a material, measured in ohms. Current – Voltage / Resistance Power (P) – The measure of electrical energy over time, measured in watts. Power Voltage *Current Watt-Hours (Wh) – A Measure of how much power could be supplied in 1 hour. A typical AA battery has a voltage of 1.5 Volts, and a supply of 3.75 Watt-Hours. This means a AA battery could supply 3.75 Watts of power for 1 hour, or 7.5 Watts of power for 30 minutes. Power supply length ( in hoursTotal Watt-Hours/ Power Summary Time Wh/P 1 AA Battery 1.5 Volts, 3.75 Wh
Robot Class Details: Add a Robot class to your project. Include all fields, properties, methods and constructors to properly build a Robot object with the following attributes and behaviors: Attributes ID (string value) must be a length of 4 or 5 characters Number of AA Batteries (int value) – must be between 2 and 6 . Resistance (double value) can be any value greater than 0 Behaviors: GetPower) returns the power, in Watts, of this robot. GetRunTime() – returns how long this robot will run, given its number of batteries (!) Remember — each AA battery can produce 3.75 Watt-Hours of energy Summary() prints the ID, Number of Batteries, Power, and RunTime values of this robot NOTE: Protect your class against invalid values! Main() Program Details: In Main(), create a program that allows the user to to enter in robot information for a number of robots, and then calculates and prints a robot summary report. Prompt the user to enter in the number of robots they wish to build. . For each robot, Prompt for the robot’s ID, Number of AA Batteries, and Resistance After all robots have been entered, output the following: o How many total batteries are required for all the robots entered? o What is the average Power of all robots entered? o Which Robot ID has the longest runtime? o Print the Summary for all robots entered. Hint: Use object’s built from the Robot class to solve these problems! .
Example output iRobot Factory (PA6) The Robot Factor ow many robots shall we build: 3 Enter Robot 1 ID: R2D2 Enter Robot 1 batteries: 3 Enter Robot 1 resistance: 550 Enter Robot 2 ID: Astro Enter Robot 2 batteries: kitten Invalid number. Try again: 5 Enter Robot 2 resistance: puppy Invalid number. Try again: 33.3 Enter Robot 3 ID: TooLong Enter Robot 3 batteries: 18 Enter Robot 3 resistance: -100 “Default ID set to “XX-XX”* *Default Batteies set to 2 *Default Resistance set to 100* otal Batteries required: 10 verage power of all robots: 0.61 obot R2D2 has longest runtime at 305.56 hours. obot Summary: 2D2: 3 Batteries 0.04 Watts (305.56 hours runtime) stro 5 Batteries 1.69 Watts (11.10 hours runtime) XX2 Batteries 0.09 Watts (83.33 hours runtime) ress any key to exit…
Expert Answer
Answer to users to keep track of robot inventory. First, you will design a Robot class, and then build an application that creates…
OR