1. #include <iostream>
#include<ctime>
using namespace std;
void MinutesHours_conversion();
void Lottery_Draw();
void Draw_SquarePattern();
void TimeConversion(int);
int main()
{
cout << "There are 4 functionality of this project.The
following list will give the options to choose for the respective
operations. Choose the correct option to proceed.Thank
You..!!!"<<endl;
int c=0;//variable to choose from the menu
while(c!=4){
cout<<"t t"<<"OPERATIONS"<<endl;
cout<<" t"<<" 1.Time conversion"<<endl;
cout<<"t 2.Print a hollow square"<<endl;
cout<<"t 3.Lottery drawing"<<endl;
cout<<"t 4.Exit";
cin>>c;
switch(c){
case 1:MinutesHours_conversion();
break;
case 2:Draw_SquarePattern();
break;
case 3:Lottery_Draw();
break;
case 4:break;
default:
cout<<"Wrong choice..!!! Please select valid options
from the menu..";
2. }
}
return 0;
}
void MinutesHours_conversion(){
int min;
cout<<" Time Conversion "<<endl;
cout << " Enter in minutes : ";
cin >> min;
TimeConversion(min);
}
void TimeConversion(int minute){
double j;
double m=(double) minute;
for(j=m;j<=m+20;j++){
cout<<j<<" minutes t";
cout<<j/60<<"hours";
cout<<"n";
}
}
void Draw_SquarePattern(){
int sz;
cout<<" Pattern of Hollow Square "<<endl;
4. // Title
cout << ' ' << endl;
cout << 't' << "Lottery Draw!" << endl;
cout << ' ' << endl;
// Call to Function
x=ball_drawdrawings(draw_ball);
// End function
}
int ball_drawdrawings(int&)
{
int draw;
double en(0), sevn(0), x_y_z(0); // The declaration of
variable are done here
double percen_en = 0.0, perc_7 = 0.0, perc_123 = 0.0;
int maxps= 1;
int count= 1;
// Input From User
cout << "Enter the number of lottery drawings that is to be
simulated ";
cin >> draw;
cout << ' ' << endl;
// Numbers randomized
srand((int)time(NULL)); // To include <ctime> header
while (count <= draw) {
for (int k=1; k<=3; k++)
{
int rounding = rand()%10+1;
6. percen_en = (en/(draw*3.0))*100.0;
perc_7 = (sevn/(draw*3.0))*100.0;
perc_123 = (x_y_z/(draw*3.0))*100.0;
// The sreen displays the output
//The checking for precision
cout << ' ' << endl;
cout << "The three ball_draws were even " << percen_en <<
"% of the time." << endl;
cout << "The number seven appeared on one of the three
ball_draws " << perc_7 << "% of the time." << endl;
cout << "The numbers 1, 2, and 3 occured on the ball_draws
" << perc_123 << "% of the time." << endl;
cout << ' ' << endl;
return rand();
}
#include <iostream>
#include<ctime>
using namespace std;
void MinutesHours_conversion();
void Lottery_Draw();
void Draw_SquarePattern();
void TimeConversion(int);
7. int main()
{
cout << "There are 4 functionality of this project.The following
l
ist will give the options to choose for
the respective operations. Choose the correct option to
proceed.Thank You..!!!"<<endl;
int c=0;//variable to choose from the menu
while(c!=4){
cout<<"
t
t"<<"OPERATIONS"<<endl;
cout<<"
t"<<" 1.Time co
nversion"<<endl;
cout<<"
t 2.Print a hollow square"<<endl;
8. cout<<"
t 3.Lottery drawing"<<endl;
cout<<"
t 4.Exit";
cin>>c;
switch(c){
case 1:MinutesHours_conversion();
break;
case 2:Draw_SquarePattern();
break;
case 3:Lottery_Draw();
break;
case 4:break;
9. #include <iostream>
#include<ctime>
using namespace std;
void MinutesHours_conversion();
void Lottery_Draw();
void Draw_SquarePattern();
void TimeConversion(int);
int main()
{
cout << "There are 4 functionality of this project.The
following list will give the options to choose for
the respective operations. Choose the correct option to
proceed.Thank You..!!!"<<endl;
int c=0;//variable to choose from the menu
while(c!=4){
cout<<"t t"<<"OPERATIONS"<<endl;
cout<<" t"<<" 1.Time conversion"<<endl;
cout<<"t 2.Print a hollow square"<<endl;
cout<<"t 3.Lottery drawing"<<endl;
cout<<"t 4.Exit";
cin>>c;
switch(c){
case 1:MinutesHours_conversion();
break;
case 2:Draw_SquarePattern();
break;
case 3:Lottery_Draw();
break;
case 4:break;
Page 1 of 3
10. ENGR 2230 Project Report Format
Note:
The entire document should have 12-point font and single-
spaced, top, bottom, left and right
margins are all 1 inch. All pages should have a page number in
the center at the bottom except
for the title page and appendices.
All headings must be numbered, centered, bolded, and
capitalized at the beginning of the section.
There must be two spaces between the heading and the
paragraph. All subheadings should be
numbered, and left justified and single-spaced.
All figures must have a number and caption underneath, all
tables must have a number and title
above it. There should be one space between the caption and
the figure or the caption and the
table.
Remember this is only a guide of the minimum requirements of
your report. Give me any other
information that you feel is significant and aids the reader in
understanding the purpose,
procedure, and results of your project.
11. Required contents
1. Cover page – including course number and name, assignment
number, date due,
student’s name, professor’s name and your signature. (You must
sign the bottom of
the report on the title page confirming that all work is a product
of your efforts only)
2. Table of Contents (including page number).
3. Problem statement – Write the complete problem statement.
This should give all of
the data and information, specifications for the desired results,
a format, etc.
4. Program description
a. Overview- Describe the strategy (modularity) used to solve
the problem.
b. Variable list – Include a list of names and descriptions of
each input, output
and process variables used in your program listing.
5. Program structure
a. Describe the overall plan (module charts) of how the program
is constructed.
b. Algorithm: List all the major formulas, the theory and
explanations needed in
developing the problem solution algorithm and the computer
program. Use
pseudo codes or flow charts to describe how the program works.
12. 6. A screen shot of Visual C++ window showing the comments
at the beginning of your
program. Must include the first line of your code. If the code is
more than one page,
print the screen shot for the first page only. (MAKE SURE it is
legible. No dark
backgrounds, and make font large)
7. Results – Show screen shots of all the results after executing
your program (if one
screen shot can not show all the results, use several screen
shots).
8. Conclusions – Discussion of the computer program and
results.
9. References – You MUST list all reference materials used
and/or related to the program.
10. Appendix – Computer Program Listing (Print directly from
Visual Studio)
Page 2 of 3
Sample of cover page for ENGR 2230
Do not include this in your report
Tennessee State University
College of Engineering, Technology, and Computer Science
13. Department of (your department)
ENGR 2230
ENGINEERING PROGRAMMING
PROJECT REPORT
BY
YOUR NAME
SUBMITTED TO
Mr. Waled Tayib
Report Submitted: Date
I pledge my honor that I have neither given nor received aid on
this work.
Signature: ________________________________ Date:
14. [Note: Please follow the format of this page exactly]
Do not include this in your report
Page 3 of 3
Sample of variable list for ENGR 2230
Do not include this in your report
Table 1. Program Variable List
Variable Name Variable Type Description
Tc double Temperature in Celsius
Tf double Temperature in Fahrenheit
15. [Note: Please follow the format of this page exactly]
Do not include in your report
#include <iostream>
#include<ctime>
using namespace std;
void MinutesHours();
void DrawLottery();
void SquarePattern();
16. void TimeConversion(int);
int main()
{
cout << "There are 4 functionality of this project.The
following list will give the options to choose for the respective
operations. Choose the correct option to proceed.Thank
You..!!!"<<endl;
int c=0;//variable to choose from the menu
while(c!=4){
cout<<"t t"<<"OPERATIONS"<<endl;
cout<<" t"<<" 1.Time conversion"<<endl;
cout<<"t 2.Print a hollow square"<<endl;
cout<<"t 3.Lottery drawing"<<endl;
cout<<"t 4.Exit";
cin>>c;
switch(c){
case 1:MinutesHours();
break;
case 2:SquarePattern();
21. }
}
void DrawLottery(){
// Declare Variables
int ball_draw,x,option;
int ball_drawdrawings(int&);
// Title
cout << ' ' << endl;
cout << 't' << "Lottery Draw!" << endl;
cout << ' ' << endl;
// Call to Function
x=ball_drawdrawings(ball_draw);
// End function
}
int ball_drawdrawings(int&)
{
22. int drawing;
double en(0), sevn(0), x1_y1_z1(0); // The declaration of
variable are done here
double percen_en = 0.0, percent_7 = 0.0, percent_123 = 0.0;
int maxps= 1;
int count= 1;
// Input From User
cout << "Enter the number of lottery drawings that is to be
simulated ";
cin >> drawing;
cout << ' ' << endl;
// Numbers randomized
srand((int)time(NULL)); // To include <ctime> header
while (count <= drawing) {
for (int k=1; k<=3; k++)
23. {
int rounding = rand()%10+1;
cout << rounding << ' ';
if (rounding == 7) {
sevn++;
}
else
{
if ((rounding % 2) == 0) {
25. count++;
}
percen_en = (en/(drawing*3.0))*100.0;
percent_7 = (sevn/(drawing*3.0))*100.0;
percent_123 = (x1_y1_z1/(drawing*3.0))*100.0;
// The sreen displays the output
//The checking for precision
cout << ' ' << endl;
cout << "The three ball_draws were even " << percen_en <<
"% of the time." << endl;
cout << "The number seven appeared on one of the three
ball_draws " << percent_7 << "% of the time." << endl;
cout << "The numbers 1, 2, and 3 occured on the ball_draws
" << percent_123 << "% of the time." << endl;
cout << ' ' << endl;
27. {
cout << "There are 4 functionality of this project.The following
list will give the options to choose for
the respective operations. Choose the correct option to
proceed.Thank You..!!!"<<endl;
int c=0;//variable to choose from the menu
while(c!=4
){
#include <iostream>
#include<ctime>
using namespace std;
void MinutesHours();
void DrawLottery();
void SquarePattern();
void TimeConversion(int);
28. int main()
{
cout << "There are 4 functionality of this project.The
following list will give the options to choose for
the respective operations. Choose the correct option to
proceed.Thank You..!!!"<<endl;
int c=0;//variable to choose from the menu
while(c!=4){