0% found this document useful (0 votes)
2 views

hw1

This document outlines Assignment 1 for the COMP2002 course at Sultan Qaboos University, focusing on C++ programming. Students are required to write a program that calculates the Gaussian distribution based on user input for mean, standard deviation, and variable. The assignment includes specific formatting and submission guidelines, along with a grading rubric.

Uploaded by

s131975
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

hw1

This document outlines Assignment 1 for the COMP2002 course at Sultan Qaboos University, focusing on C++ programming. Students are required to write a program that calculates the Gaussian distribution based on user input for mean, standard deviation, and variable. The assignment includes specific formatting and submission guidelines, along with a grading rubric.

Uploaded by

s131975
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Sultan Qaboos University

College of Science - Department of Computer Science


COMP2002: Introduction to Computer Programing for Engineers – Fall 2022
Assignment 1
10/10/2022, 23:55 pm (through Moodle)

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.

Figure.1: Sample output


Deliverable:
1) Name your program file including HW1_SEC**_*****.cpp where ** and ***** are your SECTION and student
ID number respectively. For example a student from section 10 with ID 75600 should name his C++ source code
“HW1_SEC10_75600.cpp”.
2) Upload .cpp of your program through Moodle before the due date.

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

You might also like