Use the knowledge of computational language in C code to write a code that has three different subscription packages for its customers.
To make it simpler the code is described as:
#include <iostream>
#include <string>
using namespace std;
int main() {
string package;
float time;
float price;
cout << "Choose package: ";
cin >> package;
// Package validation
if ((package == "A") || (package == "B") || (package == "C")) {
cout << "The number of hours: ";
cin >> time;
// Time validation
if (time <= 744) {
// Package A
if (package == "A") {
if (time > 50) {
price = 15 + (time - 50) * 2;
} else {
price = 15;
}
// Package B
} else if (package == "B") {
if (time > 100) {
price = 20 + (time - 100) * 1.5;
} else {
price = 20;
}
// Package C
} else if (package == "C") {
if (time > 150) {
price = 25 + (time - 150) * 1;
} else {
price = 25;
}
cout << "Price: $" << price;
}
See more about C code at brainly.com/question/19705654