Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

How is social networking used in informal training?

Answered: 1 week ago

Question

What are some career development methods?

Answered: 1 week ago