Faculty of Engineering: Receipt of Lab Report Submission (To Be Kept by Student)

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

1

FACULTY OF ENGINEERING

Experiment No./Title Structures


:

Course Code/Name: EE209/ BEE 1053 Computing for Engineers

Programme : Petroleum engineering

Name of Student : Mohamed Hussein jama

Student ID No : 1001852494

Semester : September 2020 Received by:-

Date of Experiment: 26-Nov-2020


Lecturer
Name of Lecturer : Manickam Ramasamy
Date :

Receipt of Lab Report Submission (to be kept by student)

Experiment Title : Structures

Course Code/Name: EE209 / BEE 1053 Computing for Engineers

Programme : petroleum engineering


Name of Student : mohamed Hussein jama

Student ID No : 1001852494
Received by:-
Semester : September 2020

Date of Experiment: 26-Nov-2020 Lecturer


Date :
2

EE 209 / BEE 1053 Computing for Engineers: C++ programming rubrics


Student Name: mohamed hussein jama

Student ID No:1001852494

Lab Participation Rubric


Unacceptable (0 mark) Substandard (1 mark) Adequate (2 to 3 marks)
Student was absent from lab or Student tardiness or Student arrives on time to S
did not participate. There was unpreparedness makes it lab, but may be unprepared. a
no attempt to make prior impossible to fully Answers to questions are
arrangements to make up the participate. If able to basic and superficial
lab. participate, student has suggesting that concepts are a
difficulty explaining key lab not fully grasped.
concepts.

Lab report rubric


Unsatisfactory Satisfactory Good Excellent Marks
(0 to 4 marks) (5 to 6marks) (7 to 8marks) (9 to 10 marks) Scored
Delivery  Completed  Completed  Completed  Completed
less than 70% between 70- between 80- between 90-
of the 80% of the 90% of the 100% of the
requirements. requirements. requirements. requirements.
 Not delivered  Delivered on  Delivered on  Delivered on
on time or not time, and in time, and in time, and in
in correct correct correct correct format
format format

Documentation  No  Basic  Clearly  Clearly and


Algorithm documentation documentation documented effectively
included. has been including documented
completed descriptions including
including of all descriptions of
descriptions of variables. all variables.
all variables.  Specific  Specific
 Purpose is purpose is purpose is
noted for each noted for noted for each
function. each function function,
and control control
structure. structure, input
requirements,
and output
results.

Coding  No name,  Includes  Includes  Includes name,


Standards date, or name, date, name, date, date, and
experiment and and experiment
title included experiment experiment title.
 Poor use of title. title.  Excellent use
white space  White space  Good use of of white space.
3

(indentation, makes white space.  Creatively


blank lines). program easy  Organized organized
 Disorganized to read. work. work.
and messy  Organized  Good use of  Excellent use
 Poor use of work. variables of variables
variables  Good use of (unambiguou (Unambiguous
(ambiguous variables s naming) naming).
naming). (unambiguous
naming).

Runtime  Does not  Executes  Executes  Executes


execute due to without errors. without without errors
errors.  User prompts errors. excellent user
 User prompts contain little  User prompts prompts, good
are misleading information, are use of symbols,
or non- poor design. understandab spacing in
existent.  Some testing le, minimum output.
 No testing has has been use of  Thorough and
been completed. symbols or organized
completed. spacing in testing has
output. been completed
 Thorough and output
testing has from test cases
been is included.
completed

Efficiency  A difficult and  A logical  Solution is  Solution is


inefficient solution that is efficient and efficient, easy
solution. easy to follow easy to to understand,
but it is not the follow (i.e. and maintain.
most efficient. no confusing
tricks).

Total
4

Sample input/code
/*
// mohamed Hussein jama 1001852494
Algorithm:
//step1: declaring the member names or member declaration
//step2: declaring variables to store member names.
//step3: declaring an input and output file to store in and output from there and at the
same time checking the errors.
//step4: applying arrays function to store student names and tests.
//step5: using for loop to read all the data from the input file.
//step6: displaying the numbers in 2 decimals places.
//step7: displaying the student names, tests and the total.
//step8: using for loop to display and output student names and their test marks.
//step9: add all together in order to find the average marks.
//step10: displaying the results in black screen and the output file.
//step11: using for loop and if statement to find the lowest and highest mark.
//step12: displaying the highest and lowest marks.
*/

#include <iostream>

#include <fstream>

#include <iomanip>

#include <string>

#include <cstdlib>

using namespace std;

const int NUMERCES = 6; //maximum numbers of the students struct student_marks //global
declaration

//step1

struct student_marks {

double test1, test2, test3, total=0; string name;

};
5

int main()

//step2

double highest_test1, lowest_test1=100, highest_test2, lowest_test2=100, highest_test3,


lowest_test3=100;

double avg_test1, avg_test2, avg_test3, net_total=0;

//step3

ifstream hargaisa; hargaisa.open("EE209_marks.txt"); if(hargaisa.fail())

cout<<"input file failed to open\n"; exit(1);

ofstream malaysia; malaysia.open("EE209_results.txt"); if(malaysia.fail())

cout<<"output file failed to open\n"; exit(1);

//step4

student_marks output[NUMERCES];

//step5

for(int i=0; i<6; i++)

hargaisa>>output[i].name>>output[i].test1>>output[i].test2>>output[i].test3;

//step6 cout<<fixed<<showpoint; cout<<setprecision(2); malaysia<<fixed<<showpoint;


malaysia<<setprecision(2);

//step7

cout<<setiosflags(ios::left)<<setw(15)<<"student name"<<setw(7)<<"test1"<<setw(7)

<<"test2"<<setw(7)<<"test3"<<setw(7)<<"total"<<endl;
malaysia<<setiosflags(ios::left)<<setw(15)<<"student name"<<setw(7)<<"test1"<<setw(7)

<<"test2"<<setw(7)<<"test3"<<setw(7)<<"total"<<endl;
6

//step8

for(int i=0; i<6; i++)

output[i].total=output[i].test1+output[i].test2+output[i].test3;

cout<<setiosflags(ios::left)<<setw(15)<<output[i].name<<setw(7)<<output[i].test1<<setw(7)<<output
[i].test2

<<setw(7)<<output[i].test3<<setw(7)<<output[i].total<<endl;

malaysia<<setiosflags(ios::left)<<setw(15)<<output[i].name<<setw(7)<<output[i].test1<<setw(7)<<outp
ut[i].test2

<<setw(7)<<output[i].test3<<setw(7)<<output[i].total<<endl;

//step9 avg_test1 =

avg_test1 =
(output[0].test1+output[1].test1+output[2].test1+output[3].test1+output[4].test1+output[5].test1)/6;
avg_test2 =
(output[0].test2+output[1].test2+output[2].test2+output[3].test2+output[4].test2+output[5].test1)/6;
avg_test3 =
(output[0].test3+output[1].test3+output[2].test3+output[3].test3+output[4].test3+output[5].test1)/6;

//step10 cout<<"\n"<<endl;

cout<<setiosflags(ios::left)<<setw(7)<<"average"<<setw(7)<<avg_test1<<setw(7)<<avg_test2<<setw(7)<
<avg_test3<<endl;
malaysia<<setiosflags(ios::left)<<setw(7)<<"average"<<setw(7)<<avg_test1<<setw(7)<<avg_test2<<setw
(7)<<avg_test3<<endl;

//step11

for(int i =0; i<6; i++)

if(output[i].test1>highest_test1) highest_test1=output[i].test1; if(output[i].test1<lowest_test1)


lowest_test1=output[i].test1;
7

if(output[i].test2>highest_test2) highest_test2=output[i].test2; if(output[i].test2<lowest_test2)


lowest_test2=output[i].test2;

if(output[i].test3>highest_test3) highest_test3=output[i].test3; if(output[i].test3<lowest_test3)


lowest_test3=output[i].test3;

//step12

cout<<"\ntest1 highest marks is "<<highest_test1<<endl; malaysia<<"\ntest1 highest marks is


"<<highest_test1<<endl;

cout<<"\ntest1 lowest marks is "<<lowest_test1<<endl; malaysia<<"\ntest1 lowest marks is


"<<lowest_test1<<endl; cout<<"\ntest2 highest marks is "<<highest_test2<<endl; malaysia<<"\ntest2
highest marks is "<<highest_test2<<endl; cout<<"\ntest2 lowest marks is "<<lowest_test2<<endl;
malaysia<<"\ntest2 lowest marks is "<<lowest_test2<<endl; cout<<"\ntest3 highest marks is
"<<highest_test3<<endl; malaysia<<"\ntest3 highest marks is "<<highest_test3<<endl; cout<<"\ntest3
lowest marks is "<<lowest_test3<<endl; malaysia<<"\ntest3 lowest marks is "<<lowest_test3<<endl;

net_total =
(output[0].total+output[1].total+output[2].total+output[3].total+output[4].total+output[5].total)/6;
cout<<"the average total marks of the students are "<<net_total<<endl;

malaysia<<"the average total marks of the students are "<<net_total<<endl;

hargaisa.close();

malaysia.close();

return 0;

}
8

Sample outputs
9
10

You might also like