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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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