My professor said that my code needs to look more original. can you give me tips or show me what else I can do to make the code look more original? here's the code: #include #include #include using namespace std; int main() { //variables and constants int package; double data; double totalCharges = 0.0; cout << "iMobile Bill Calculator ..." << endl; // When the package entered is not valid while (true) { cout << "\nSelect a subscription :" << endl;; cout << "\t\t1. Package A" << endl; cout << "\t\t2. Package B" << endl; cout << "\t\t3. Package C" << endl; cout << "Package: "; cin >> package; if (package >= 1 && package <= 3) break; else cout << "Error ... Invalid package. Try again." << endl; } // When Gigabytes entered is not valid while (true) { cout << "\nHow many gigabytes of data were used? "; cin >> data; if (data < 0) { cout << "Error ... Invalid gigabytes entered. Try again." << endl; } else break; } switch (package) { // Monthtly Charges for Plan A case 1: { if (data >= 0 && data <= 4) { totalCharges = 39.99; } // Monthtly Charges for Plan A with additional data costs else { totalCharges = 39.99 + (data - 4) * 10; } break; } // Monthtly Charges for Plan B case 2: { if (data >= 0 && data <= 8) { totalCharges = 59.99; } // Monthtly Charges for Plan B with additional data costs else { totalCharges = 59.99 + (data - 8) * 5; } break; } // Monthly Charges for Plan C case 3: { totalCharges = 75; break; } } // Display the monthly total amount cout << "The total amount due is $" << totalCharges << endl; cout << endl; return 0; }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

My professor said that my code needs to look more original. can you give me tips or show me what else I can do to make the code look more original?

here's the code:

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
//variables and constants
int package;
double data;
double totalCharges = 0.0;

cout << "iMobile Bill Calculator ..." << endl;

// When the package entered is not valid

while (true) {
cout << "\nSelect a subscription :" << endl;;
cout << "\t\t1. Package A" << endl;
cout << "\t\t2. Package B" << endl;
cout << "\t\t3. Package C" << endl;
cout << "Package: ";
cin >> package;
if (package >= 1 && package <= 3)
break;
else
cout << "Error ... Invalid package. Try again." << endl;
}
// When Gigabytes entered is not valid
while (true) {
cout << "\nHow many gigabytes of data were used? ";
cin >> data;
if (data < 0) {
cout << "Error ... Invalid gigabytes entered. Try again." << endl;
}
else
break;
}
switch (package) {
// Monthtly Charges for Plan A
case 1: {
if (data >= 0 && data <= 4) {
totalCharges = 39.99;
}
// Monthtly Charges for Plan A with additional data costs
else {
totalCharges = 39.99 + (data - 4) * 10;
}
break;
}
// Monthtly Charges for Plan B
case 2: {
if (data >= 0 && data <= 8) {
totalCharges = 59.99;
}
// Monthtly Charges for Plan B with additional data costs
else {
totalCharges = 59.99 + (data - 8) * 5;
}
break;
}
// Monthly Charges for Plan C
case 3: {
totalCharges = 75;
break;
}
}

// Display the monthly total amount
cout << "The total amount due is $" << totalCharges << endl;
cout << endl;


return 0;
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY