Sie sind auf Seite 1von 3

ASSIGNMENT 1 (SEQUENTIAL CONTROL STRUCTURE)

CSC128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING

Question(CO1-LO1, CO2-LO1) :

The question is designed to map CO1-LO1 and CO2-LO1matrices.


CO1 – Ability to identify the steps in problem solving
CO2 – Ability to state the problem according to a given requirement
LO1 – Knowledge

(Civil Engineering) Write a program using C++ programming language to calculate the stress
on a steel I-beem having a rectangular moment of inertia of I, and a height of h inches, when a
load of L lbs is placed f feet from fixed end. The stress placed on the fixed end of a symmetrical
steel I-beem can be determined by this formula:
S
S is the stress in lbs/in2
is the weight, in lbs, of the load placed on the beam
is the beam’s rectangular moment of inertia
is the distance in inches the load is placed from the fixed end of the beam (moment arm)
is one-half the height in inches of a symmetrical beam

Examples of the execution are as follows:

Calculate The Strees on A Steel I-beam


--------------------------------------

Enter the following :


Weight (L) of load (lbs) : 700
Distance (f) of load (feet) : 8
Height of beam (inches) : 6
Rectangular moment of inertia (I) : 21.4

The stress on steel I-Beam is 1099065.420561 lbs/in^2

You can use predefined function from iomanip.h class library to beautify your output.

YOU ARE REQUIRED TO:

a. Identify the output, input and process for the above problems using CoPS Method (refer to
the next page).
b. Using the specification obtained in (a), draw flowchart to illustrate the algorithm of getting
the inputs, processes and producing the outputs.
c. Write a C++ program based on (b).
CoPS METHOD

Example: If you are given the radius of one circle, you can calculate the area of that circle. Write a
complete C++ program to calculate and display the area of the circle. Assume the value of is 3.142.

Output Input Process


Output variables: Input variables: Processing items:
area radius area

Formulae:
area = PI * radius * radius

Constants: Steps / Solution algorithm:


PI = 3.142 1. Get input (from keyboard)
Read radius
2. Calculate area (in CPU and Memory)
area = PI * radius * radius
3. Display output (to screen console)
Print area

Instruction to the students (Please read carefully and thoroughly):

You are required to submit your program in hardcopy format only. You are also required to
demonstrate the execution of your program to your lecturer for approval before the submission,
and the output of the program must be printed out and attached together during submission.
The cover or the front page for your ASSIGNMENT 1 must be YELLOW in colour using the
standard format (please download the example of front page from Roslan Sadjirin folder in i-
learn portal).

The Scoring Rubric for marking scheme must be attached together during submission of your
assignment; otherwise NO marks will be given for your assignment.

Deadline is on July 12th, 2012, 5:00 PM. Late submission and plagiarism will be penalised and
marks will be deducted.
ASSIGNMENT 1 (SEQUENTIAL CONTROL STRUCTURE)
CSC128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING

Scoring Rubric

20
Student ID : ________________________________________________________________
Name : ______________________________________________________________
Group : ______________________________________________________________

Marking Scheme
Remarks
Category
Weak Moderate Good Very Good
Problem analysis, precision 1 2 3 4
and clarity of flowchart /
pseudocode Output, input and process is correctly identified.
Flowchart or pseudocode is correctly drawn and written.
1 2 3 4
Clarity of program’s
The program is clearly written as well as easy to understand.
presentation
Each of the process is documented.

1 2 3 4
Structure and algorithm of
a program The algorithm of the program is capable of solving the
problem completely. There is no syntax error, logic error
and run-time error.
Important required 1 2 3 4
variables for input, process
All input, process and output variables are clearly defined
and output
and outlined

1 2 3 4
The program produced expected output with correct and
Result
presentable format.

Das könnte Ihnen auch gefallen