Professional Documents
Culture Documents
Adul Rehman PF LAB 1
Adul Rehman PF LAB 1
return 0;}
Get the values of original_price, mark_up and tax_rate and store them.
Calculate mark_up price and Display. Calcultate Sales Tax and Display. Calculate Final Price and
Display.
Assignment # 1
2. If you buy a 40GB hard drive, then chances are that the actual storage on the hard
drive is not 40GB. This is due to the fact that, typically, a manufacturer considers that
1000 bytes are equal to 1KB, 1000KB is equal to 1MB, 1000MB is equal to 1GB.
Therefore, according to the manufacturer, a 40GB hard drive contains 40,000,000,000
bytes. This is wrong because in computer memory, 1KB is equal to 1024 bytes, and so
on. So the actual storage on a 40GB hard drive is approximately 37.25GB. Write a
program that prompts the user to enter the size of the hard drive specified by the
manufacturer, on the hard drive box, and outputs the actual storage capacity of the hard
drive.
#include <iostream>
int main(){
double givensize, realsize;
cout << "Hard Drive is actually: " << realsize << "GB" << endl;
return 0;
}
Display realsize.
Assignment # 1
3. You found an exciting summer job for five weeks. It pays, say, $15.50
per hour. Suppose that
the total tax you pay on your summer job income is 14%. After paying the
taxes, you spend
10% of your net income to buy new clothes and other accessories for the
next school year
and 1% to buy school supplies. After buying clothes and school supplies,
you use 25% of the
remaining money to buy savings bonds. For each dollar you spend to buy
savings bonds,
your parents spend $0.50 to buy additional savings bonds for you. Write a
program that
prompts the user to enter the pay rate for an hour and the number of hours
you worked each
week. The program then outputs the following:
a) Your income before and after taxes from your summer job.
b) The money you spend on clothes and other accessories.
c) The money you spend on school supplies.
d) The money you spend to buy savings bonds.
e) The money your parents spend to buy additional savings bonds for you
Assignment # 1
#include <iostream>
#include <iomanip>
int main(){
double payRate, grossIncome, netIncome, schoolAmount, bondsAmount;
double clothesAmount, parentsBondsAmount, hoursWorked;
return 0;
}
Assignment # 1
Pseudo Code: Declare payRate, grossIncome, netIncome, schoolAmount, bondsAmount, clothesAmount,
parentsBondsAmount and hoursWorked as doubles.