Write a program that: program starts; declares and initializes to .06625 constant float variable NJSALES_TAX; declares and initializes to 1000 an integer variable total; declares and initializes to zero a float variable grand_total; prompt and input on new line total; calculate grand_total to equal total plus (total*SALES TAX); if grand_total <= 1000 print on new line "Grand total is less than or equal to 1000 it is $" and the grand_total to two decimal places; else if grand_total between 1000 <= 2000 print on new line "Grand total is more than 1000 less than or equal to 2000 it is $" and the grand_total to two decimal places; else print on new line "Grand total is greater than 2000 it is $" and the grand_total to two decimal places; just before ending print on new line "Program finished!" then terminate program.

Respuesta :

Answer:

Written in C++

#include<iostream>

using namespace std;

int main() {

const float SALES_TAX = 0.06625;

int total = 1000;

cout<<"Total: ";

cin>>total;

float grand_total = 0;

grand_total = total + total * SALES_TAX;

if (grand_total <= 1000) {

cout<<"Grand total is less than or equal to 1000 it is $";

printf("%.2f", grand_total);  

}

else if (grand_total > 1000 && grand_total <= 2000 ) {

cout<<"Grand total is more than 1000 less than or equal to 2000 it is $";

printf("%.2f", grand_total);  

}

else {

cout<<"Grand total is greater than 2000 it is $";

printf("%.2f", grand_total);  

}

cout<<"\nProgram finished!";

return 0;

}

Explanation:

I've added the full source code as an attachment where I use comments to explain difficult lines

Ver imagen MrRoyal