Display program description to user before asking for input

Assignment Help Programming Languages
Reference no: EM131266025

According to Coulomb's Law, two electrically charged particles attract or repel one another with a force F that is proportional to their charges q1 and q2 and inversely proportional to the square of the distance r between them: F = k q1 q2 / r 2 The constant of proportionality, k, is called Coulomb's constant. If the force is measured in newtons (that is, kilogram-meters per second squared) and the charges are measured in coulombs, the value of Coulomb's constant is 8.988 * 109 newton-square-meters per square coulomb (8.988 * 109 N m2 / C2). Analyze the problem, design a solution and then develop a C++ program to implement the formula above to computes the force of repulsion between two similarly charged particles, given their charges (in coulombs) and the distance between them (in meters). Prompt user for charge for each particle and the distance between them. Produce a report presenting all the values clearly labeled including units associated with them. Print the values in 2 forms once in fixed format using 5 digits precision for all values and a second time using scientific notation. Make sure to include your analysis and design (algorithm) as a comment block with your program

Program #2

A right circular cone has a circular base, and the line from the center of the base to the tip of the cone forms a right angle with the base.

If you know the height (h) of a cone and the radius (r) of the base of the cone, then you can calculate the slant height (s), surface area (a), and volume (v) of the cone using the following formulas.

Slant Height: s = √

Surface Area: A =

Volume: v =

Note that the slant height is the hypotenuse of the right triangle, whose other two sides are the height and the radius of the base.

Again, don't let the equations intimidate you. These formulas simply perform addition, multiplication, division, squaring, and finding a square root.

Requirements:

Write a program that will:

Display a program description to the user before asking for any input.

Defines a constant for PI, using fixed notation, carried out to 5 decimal places (value for Pi was given in program 1).

Read the height of a right circular cone, as input from the user.·

Read the radius of the base of a right circular cone, as input from the user.

Reference no: EM131266025

Questions Cloud

Determine its voltage-ratio and the kva rating : Mark on the diagram, the magnitudes and relative directions of the currents in the winding as well as in the input and output lines when delivering the rated kVA to load.
Macroeconomic nature of leading indicators : Discuss a scenario in which the use of leading indicators for your industry or firm (or an industry or firm of your choosing, could be fictitious or general) might improve performance and promote better decision making. Be sure to discuss at least..
Create a program that has an object type of contact : Create a program that has an object type of Contact. This contact will need to have the following attributes: Name, Birth Date, Phone Number, Address and Eye Color.
Jaeho and lawrence scores on the exam : Does Jaeho have a dominant strategy with regard to concealing or revealing his answers? Explain your answer. Does Lawrence have a dominant strategy with regard to concealing or revealing his answers? Explain your answer. What do you predict will be J..
Display program description to user before asking for input : Display a program description to the user before asking for any input. Defines a constant for PI, using fixed notation, carried out to 5 decimal places (value for Pi was given in program 1).
Should jane claim that she is hispanic american : Does the information you collected during this activity improve your evaluation of the company? - Should Jane claim that she is Hispanic American? Explain your response.
Tax incidence split between workers and firms : Suppose that after the tax is imposed, the wage rate rises to $12.00 an hour and that only 8,000 workers are employed. How is the tax incidence split between workers and firms?
Define private instance variables to store basic details : CPT121 / COSC2135 Programming Assignment. Define private instance variables to store basic RentalMovie details: Also define the private boolean instance variables: Provide a pre-defined constructor for the class
Where is an autotransformer employed in a power system : In a transmission system the star side of a star/delta transformer is HV side, while in a distribution system the star side is the LV side. Explain.

Reviews

Write a Review

Programming Languages Questions & Answers

  Design architecture of system to accept natural language

Using the generic model of a language processing system presented here, design the architecture of a system that accepts natural language commands and translates.

  Display the total sales.

Display the salesperson with the top required sales.

  A primitive data type that represents either true or false

A primitive data type that represents either true or false.

  Explaining data-driven multicast routing paradigm

The data-driven multicast routing paradigm works best on local networks that have low delay and excess capacity, while the demand driven paradigm works best in a wide are environment.

  Write script in unix to monitor creation of pdf in directory

Write script in unix which monitors creation of .pdf or PDF file in current directory. Every minute it must display list of these filenames created after previous display a list.

  Basic concepts of object-oriented analysis and design

Diagram methods introduces the student to the basic concepts of object-oriented analysis and design. Use case modeling, class modeling and state modeling using common notations are covered

  Creating printstream object using dos

Create a PrintStream object using dos and assign the resulting reference to ps, a PrintStream variable that has already been declared.

  Definition of function quadratic receives double parameters

Write down definition of function named quadratic which receives 3 double parameters a , b , c . If value of a is 0 then function prints the message "no solution for a=0"

  Program to compute total price of items before tax

Program is to compute total price of items before tax and then tax payable on those items. Tax payable is computed by applying tax rate percentage to total price.

  Write specifications for method of pre- and post-conditions

Write down specifications for method which advances any given date by one day. Write down statement of purpose, pre- and post-conditions, and description of parameters.

  Html/css

"Validating Your Work" Please respond to the following:  Describe attribute minimization. Explain what would happen if you tried to validate a page containing instances of attribute minimization. Propose a solution to this problem.

  Create class using static variable to store annual interest

Create class SavingAccount. Use a static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance indicating the amount.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd