×
Reviews 4.9/5 Order Now

C++ Program to Implement Internet Service Provider Assignment Solution

June 24, 2024
Dr. Olivia Bennett
Dr. Olivia
🇦🇺 Australia
C++
Dr. Olivia Bennett holds a PhD in Computer Science from a prestigious university in the UK. With over 800 completed orders, she specializes in GUI development and database integration in Qt programming. Her expertise lies in crafting intuitive user interfaces and seamlessly integrating database functionalities into Qt applications.
Key Topics
  • Instructions
    • Objective
  • Requirements and Specifications
Tip of the day
Use functions to avoid repeating code and make your program organized. Test each part step-by-step, and rely on built-in libraries instead of writing everything from scratch. Clean and clear code always scores better.
News
The newly-established German University of Digital Science (Germany) began operations in April 2025, offering fully digital English-language programmes in fields such as AI, cybersecurity and digital reality — specifically designed for international students including those from the Global South.

Instructions

Objective

Write a C++ assignment program to implement internet service provider.

Requirements and Specifications

program-to-implement-internet-service-provider-in-C

Source Code

#include #include using namespace std; int main() { // Ask for letter package string package_name; while(true) { cout << "Enter package: "; cin >> package_name; if(package_name.compare("A") == 0 || package_name.compare("a") == 0 || package_name.compare("B") == 0 || package_name.compare("b") == 0 || package_name.compare("C") == 0 || package_name.compare("c") == 0) { break; } else { cout << "Please enter a valid package name (A, B or C)" << endl; } } // Now, ask for hours int hours; while(true) { cout << "Enter number of hours: "; cin >> hours; if(hours > 0) { break; } else { cout << "Please enter a positive number of hours." << endl; } } // Now, calculate double monthly_cost; double hour_cost; double total_cost; int max_hours; if(package_name.compare("A") == 0 || package_name.compare("a") == 0) { monthly_cost = 9.95; hour_cost = 2.00; max_hours = 10; total_cost = monthly_cost; // Calculate if(hours > max_hours) { total_cost = monthly_cost + (hours - max_hours)*hour_cost; } } else if(package_name.compare("B") == 0 || package_name.compare("b") == 0) { monthly_cost = 13.95; hour_cost = 1.00; max_hours = 20; total_cost = monthly_cost; // Calculate if(hours > 120) { total_cost = monthly_cost + (hours - max_hours)*hour_cost; } } else // it is package C { monthly_cost = 19.95; hour_cost = 0.00; total_cost = monthly_cost; } // Finally, display cout << "Your total bill for this month is: $" << total_cost << endl; }

Similar Samples

"Explore our curated samples at ProgrammingHomeworkHelp.com to witness our expertise in diverse programming assignments. These examples demonstrate our commitment to delivering precise and efficient solutions tailored to your academic or professional requirements. Dive into our samples to experience how we can assist you in mastering programming challenges effectively.