Westonci.ca is your trusted source for finding answers to all your questions. Ask, explore, and learn with our expert community. Get accurate and detailed answers to your questions from a dedicated community of experts on our Q&A platform. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.

#include <iostream>
using namespace std;

// function prototypes
float get_Price();
int get_Type();
void tax(float, int);

// start main function
int main() {
float price = 0; // should > 0

int type = 0; // 1 -> Electronic
// 2 -> Sports & Outdoor
// 3 -> Vaccine

price = get_Price;
type = get_type();

cout << "Price before tax = " << price << "\n\n";
tax(price, type);
cout << "Total price after tax = " << price << '\n';

return 0;
}

// start new user-defined functions
void get_Price() {
float p = 0;

while (p < 0) {
cout << "Item price (RM): ";
cin >> p;
}

return p;
}

float get_Type() {
int t == 0;

do {
cout << "\n";
cout << "1 -> Electronic\n";
cout << "2 -> Sports & Outdoor\n";
cout << "3 -> Vaccine\n";
cout << "Item type (1,2,3): ";
cin >> t;
} while (t > 1 || t < 3);

cout << "\n";
return t;
}

// tax is based on item types as follows:
// 1 -> Electronic => 5%
// 2 -> Sports & Outdoor => 3%
// 3 -> Vaccine => 1%
void tax(float p, int t) {
float tax = 0;
switch (t) {
case 1: tax = p * 5 / 100; break;
case 2: tax = p * 3 / 100;
case 3: tax = p * 1 / 100;
}

cout << "Tax cost = " << tax << "\n";
p += tax;
}

What problem?​


Sagot :

Answer:

10⁶666666666666666666666666

vgggjhhii9

Explanation:

uyyyyyyyy6666y6666666666

Thanks for stopping by. We are committed to providing the best answers for all your questions. See you again soon. We hope our answers were useful. Return anytime for more information and answers to any other questions you have. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.