hw1
hw1
The purpose of this assignment is to practice the use of basic elements of the C++ programming
language to develop a solution to the given problem. Your solution will consist of two parts: (Part I) your
name, university Id, section number and Engineering Problem Solving Methodology. This latter should be
written as comments at the beginning of your program (Part II) the corresponding C++ program
Problem Definition
The Gaussian distribution is given by:
𝑓(𝑡) =
𝜎√2𝜋
Where µ, is the mean, sd, is the standard deviation, and t, is the variable of the function; e is the exponential function
and π = 3.1415 (Note: pi constant)
Write a C++ program that asks the user to enter the values of µ, s, and t; then calculates and prints the value of f(t).
Use the C++ function ‘exp’ to compute the exponential of x (ex). Your program should:
a) Use appropriate variable names, and meaningful comments to describe the algorithm.
b) Use appropriate messages and a suitable format to display the result (see Figure 1)
c) Display the floating-point numbers up to 3 decimal places.
Grading Table
Item mark
Problem Solving Methodology (written as a comments at the beginning of /5
your program)
Comments /1
Include Libraries /2
Variables and constants (Naming in accordance to Python convention) /2
Reading data /2
Calculations /3
Displaying the results (with correct format) /2
Program compiles and runs without errors /2
Proper Naming & Submission /1
TOTAL /20