Question: CSC100AA and CIS162AA Program 1 - AmpsCalculation Please adhere to the C++ Standards and Guidelines document on the class site . Submit the following: List

CSC100AA and CIS162AA

Program 1 - AmpsCalculation

Please adhere to the C++ Standards and Guidelines document on the class site. Submit the following:

List of source code with comments to document

Test output listed as comments at the end of your program

AmpsCalculation.cpp (5 pts)

Write a program that prompts the user for two double variables, the voltage (V) and resistance (R). Calculate and display the current in amps (I).

Calculate and display the power dissipation in watts (P).

Recall Ohms Law is I = V/R, where I is current in amps, V is voltage, and R is resistance. Also use P = I2R for the power calculation.

Use all double numbers and variables. Format all results to display 2 decimal places. Include output from this test data. Its from a toaster: Voltage is 120 and Resistance is 9.29. Example Output:

Enter the voltage: 120

Enter the resistance: 9.29

Given a voltage (V) of: 120 and resistance (R) of: 9.29

The amps (I) are: 12.92

The power (P) is: 1550.05

Style notes about variable and constant names:

Variable names must be meaningful based on their content. Begin a variable name with a small letter. If your identifier has more than one word or shortcut for a word, start each one with a capital letter. Some good examples include:

o for exam score use names like examScore.

o for miles per gallon names use names like milesPerGallon, milesPerGal

Constant names must be meaningful based on their content. So it is easily recognized as a constant, use all capital letters. Some good examples include:

o PI, SALES_TAX_RATE, and NICKEL_VALUE



Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!