Hello people! Got a project due tomorrow been at it the whole day still no luck hopping one of you guys could help me out before tomorrow :/
First one...... This is the code
int main()
{
const double Tax = 0.0825, Rate = 0.15;
int PartNum, Units;
double Price, Sales, DiscountSales, SalesTax, TotalSales;
cout<<"Enter the four-digit part number ----->";
cin>>PartNum;
cout<<"Enter the price in dollars----->";
cin>>Price;
cout<<"Enter the number of units---->";
cin>>Units;
#include <iomanip>
#include <iostream>
using namespace std;
cout<<endl<<"****** Purchase Receipt ******"<<endl;
cout<<"Part #"<<setw(10)<<PartNum<<endl;
cout<<Units<<" @ ";
cout<<"$"<<fixed<<Price<<setw(8)<<"per unit"<<endl;
cout<<"Sales: $"<<DiscountSales<<endl;
cout<<"Tax: $"<<setprecision(4)<<scientific
<<SalesTax<<endl;
cout<<"Discount: $"<<fixed
<<(Sales - DiscountSales)<<endl
<<"Total: $"<<setprecision(2)<<TotalSales;
return 0;
}
I got the first part right when i compile and run
it does what it's supposed to and asks for the specific values
but the second part where it's supposed to calculate and do the receipt
is not working for me... idk what im doing wrong.
The final output is supposed to look like this
****** Purchase Receipt ******
Part #1234
15 @ $11.59 per unit
Sales: $147.77
Tax: $12.19
Discount: $26.08
Total: $159.96
Can someone correct me Please.
The instruction for the second Homework is
Project #1: Exercise the writing of a simple program composed of variables and output statements
This project is an exercise of writing a program in which several variables are declared and values assigned to those variables and values of variables printed out on the screen. This project is designed to put what we have learned in Chapter 2 into practice.
Use Visual C++ to write your program.
Activity 1. Read the following code, which is an incomplete program. Enter the code in the editing window of Visual C++.
#include <iostream>
using namespace std;
int main()
{
// Section 1: Declarations that you need to make
// Section 2: Assignments that you need to put here to assign values to variables you have declared in Section 1
// Section 3: Put output statement here to print out the values you have assigned to variables in Sections 2.
return 0;
}
Activity 2. In Section 1 of the previous incomplete program, write declaration statements to declare three variables of type string, and two variables of type char. The string variables should be named make, model, and color. The char variables should be named plateType and classification.
Activity 3. In Section 2, write assignments to assign values to those variables you have declared in Section 1. Figure out the value for each variable. For example, if the output is the one described in Activity 4, the values for the three string variables should be "Ford", "Taurus", and "Red", respectively; and the values for the two char variables should be 'H' and 'L', respectively. You can use other values as you want.
Activity 4. In Section 3, write a series of output statements that print out the values in the variables declared in Sections 1. The values should each appear on a separate line, with a blank line between the string and char values. Each value should be preceded by an identifying message on the same line. An example output is:
The vehicle is manufactured by Ford
Its model is Taurus
Its color is Red
Its platetype is H
Its class is L
i've gotten this far
#include <iostream>
using namespace std;
int main()
{
const string Part1 ="make";
const string part2 ="model";
const string part3 ="color";
}
return 0;
Absolutely no idea after that i would appreciate any help thanks.