COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
checkpoint3.5.cpp
Go to the documentation of this file.
1
#include <iostream>
2
using namespace
std;
3
const
int
NUM
= 10;
4
const
double
X
= 20.5;
5
int
main
()
6
{
7
int
a, b;
8
double
p;
9
char
grade;
10
a = 23;
11
cout <<
"a = "
<< a << endl;
12
cout <<
"Enter two integers: "
;
13
cin >> a >> b;
14
cout << endl;
15
cout <<
"The numbers you entered are "
16
<< a <<
" and "
<< b << endl;
17
p =
X
+ 2 * a - b;
18
cout <<
"p = "
<< p << endl;
19
grade =
'B'
;
20
cout <<
"Your grade is "
<< grade << endl;
21
a = 2 *
NUM
+ p;
22
cout <<
"The value of a = "
<< a << endl;
23
return
0;
24
}
NUM
const int NUM
Definition
checkpoint3.5.cpp:3
X
const double X
Definition
checkpoint3.5.cpp:4
main
int main()
Definition
checkpoint3.5.cpp:5
Module3
checkpoint3.5.cpp
Generated on Sun Sep 29 2024 16:39:53 for COMP2113 by
1.12.0