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

Lab Sol Manual

The document is a lab report containing 9 tasks. Each task provides the input code and output for a different C++ programming problem. The problems include determining the number of days in a month based on user input, calculating denominations of currency for a cash amount, and calculating an electricity bill based on consumption tier pricing structures.

Uploaded by

aweertt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lab Sol Manual

The document is a lab report containing 9 tasks. Each task provides the input code and output for a different C++ programming problem. The problems include determining the number of days in a month based on user input, calculating denominations of currency for a cash amount, and calculating an electricity bill based on consumption tier pricing structures.

Uploaded by

aweertt
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

LAB REPORT # 3

INSTRUCTOR NAME:-
Group Members:-
DEPARTMENT:-
ELECTRICAL ENGINEERING
SYNDICATE:-

TASK 1:-
INPUT
OUTPUT:-

TASK 2:-
INPUT:-
OUTPUT:-

TASK 3:-
INPUT
OUTPUT

TASK 4:-
INPUT
OUTPUT

TASK 5:-
INPUT

OUTPUT

TASK 6:-
INPUT
#include <iostream>
using namespace std;
int main(){
int a;
cout << "enter the month no: ";
cin >> a;
if (a == 1 || a == 3 || a == 5 || a == 7 || a == 8 || a == 10 || a == 12)
cout << "no of days:31 " << endl;
if (a == 4 || a == 6 || a == 9 || a == 11)
cout << "no of days:30 " << endl;
if (a == 2)
cout << "no of days:28 " << endl;
return 0;
}

OUTPUT
enter the month no: 3
no of days:31
Press any key to continue . . .
TASK 7:-
INPUT
#include <iostream>
using namespace std;
int main(){
int a = 0, a500,a100, a50, a20, a10, a5, a2, a1;
cout << "enter the amount" << endl;
cin >> a;
a500 = a / 500;
a = a % 500;
a100 = a / 100;
a = a % 100;
a50 = a / 50;
a = a % 50;
a20 = a / 20;
a = a % 20;

a10 = a / 10;
a = a % 10;
a5 = a / 5;
a = a % 5;
a2 = a / 2;
a = a % 2;
a1 = a / 1;
cout << "we need " << a500 << "notes of 500 " << endl;
cout << a100 << "notes of 100 " << endl;
cout << a50 << "notes of 50 " << endl;
cout << a20 << "notes of 20 " << endl;
cout << a10 << "notes of 10 " << endl;
cout << a5<< "notes of 5 " << endl;
cout << a2 << "notes of 2 " << endl;
cout << a1 << "notes of 1 " << endl;
system("pause");

OUTPUT
enter the amount
999
we need 1notes of 500
4notes of 100
1notes of 50
2notes of 20
0notes of 10
1notes of 5
2notes of 2
0notes of 1
Press any key to continue . . .

TASK 8:-
INPUT
#include <iostream>
#include <cmath>
using namespace std;
void main()
{
const float b = .50;
const float c = .75;
const float e = 1.20;
const float f = 1.50;
const float d = 0.2;

float units, bill, tbill, scharge, j, k, l, m, n, o;


cout << "enter your units " << endl;
cin >> units;
if (units <= 50)
{
bill = units*b;
cout << "bill to units is =" << bill << endl;
scharge = bill*(d);
tbill = bill + scharge;
cout << "total bill \n=" << tbill;
}
else if (units > 50 & units <= 150)
{
bill = (50 * b) + (units - 50) * c;
cout << "bill to units is =" << bill << endl;
scharge = bill*(d);
tbill = bill + scharge;
cout << "total bill is " << tbill << endl;
}
else if (units > 150 & units <= 250)
{
bill = (50 * b) + (100 * c) + (units - 150) * e;
cout << "bill to units is =" << bill << endl;
scharge = bill*(d);
tbill = bill + scharge;
cout << "total bill is " << tbill << endl;
}
else
{
bill = (50 * b) + (100 * c) + (100 * e) + (units - 250) *1.50;
cout << "bill to units is =" << bill << endl;
scharge = bill*(d);
tbill = bill + scharge;
cout << "total bill is " << tbill << endl;
}

system("pause");
}

OUTPUT
enter your units
556
bill to units is =679
total bill is 814.8
Press any key to continue . . .
TASK 9:-

INPUT

Output:-

You might also like