NOTE: I have completed the program for your assignment. Please check and let me know if you have any questions. I will acknowledge back with a response within 24 hours. Thanks for your patience.
The file CustomersA.txt you have given is a screenshot and i was not able to copy the contents. So i have picked the first three lines as a sample and tested the program. You create the original CustomersA.txt file and test the program.
Code:
#include <iostream>
#include <fstream>
using namespace std;
// function declaration
double calculateCost(int, int, int, int);
int main()
{
// file and variable declaration
ifstream infile("CustomersA.txt");
int lines, mins, texts, gb;
double cost;
// reading each line from file
if (infile.is_open()){
while(infile >> lines >> mins >> texts >> gb){
// passing the attributes to calculateCost to determine the total cost customer has to pay
cost = calculateCost(lines, mins, texts, gb);
cout << "Customer has to pay: " << cost << endl;
}
}
else
cout << "Some issue while file opening, plese check..." << endl;
cout << endl;
return 0;
}
double calculateCost(int lines, int mins, int texts, int gb)
{
double total_cost;
total_cost = 6 * lines; // line cost
total_cost += 0.02 * mins; // calls
total_cost += 0.25 * texts; // message cost
total_cost += 10 * gb; // Data cost
return total_cost;
}
Codee output screenshot:
EXERCISE Cell Phone Bill The total cost for your bill is sum of the base plan and the additional cost for extra minutes and texts The charges are: Base plan: $40.00 Additional Minutes: $2.61 Additional Texts: $3.15 Additional Data: $12.20 Enter your value as a decimal number, dollar and cents. For example, enter $13.45 as 13.45 West (4 of 4) Check 10 item attempts remaining Try Another Version Submit Answer
Q2.1) Write a program to calculate phone bill of the user. The rule to calculate bill is given as follows: • You should ask the option to the user at first. If the phone bill will be calculated with internet connection option, user must enter 1, otherwise user must enter O. Do all necessary controls and take the number from the user until the user enters one of the correct options. (1 or 0). • Design 2 different methods. Both...
Write the pseudocode to produce a bill for cell phone charges. Data fields will include the date, number called, number of minutes, and cost (rate × minutes). Data should be loaded into an array. Include totals for the number of minutes and cost.
Lab 8: Cell Phone Bill CalculatorWrite the Python code for the following programming problem definition.Use modular design according to the modules specified below.Design and write a program that calculates and displays the number of minutes over the monthly contract minutes that a cell phone user incurred. The program should askthe user how many minutes were used during the month and how many minutes they were allowed. Validate the input as follows:• The minimum minutes allowed should be at least 100,...
According to one study, the average monthly cell phone bill in the U.S. is $70. If a 20-year old student with an average bill gives up her cell phone and each month invests the $70 she would have spent on her phone bill in a savings plan that averages a 4% annual return, how much will she have saved by the time she is 65?
The average single smart phone cell phone bill is now averaging $73 with a standard deviation of $20. What is the probability that a sample mean of 40 produces a sample mean equal to $73?
The average single smart phone cell phone bill is now averaging $73 with a standard deviation of $20. What is the probability that a sample mean of 40 produces a sample mean between $70 and $80?
64. Write a function d G) that represents the sale price of a cell phone after applying only the 25% off discount where x represents the original price of the cell phone B. Write a function c(x)that represents the cost of a cell phone after applying only the $150 off coupon where x represents the original price of the cell phone. C. Write a new function f(x) = d(c(x)) and explain in words what this means in the context of...
Write a C program that computes the tax and tip on a restaurant bill for a patron with a $88.67 meal charge. The tax should be 6.75 percent of the meal cost. The tip should be 20 percent of the total after adding the tax. Display the meal cost, tax amount, tip amount, and total bill on the screen.
The average monthly cell phone bill was reported to be $73.00 by the U.S. Wireless Industry. A random sampling of ten large cell phone company found the following monthly cell phone charges yields a sample mean of $78.47 with a population standard deviation of $7.41. At the 0.05 level of significance, can it be concluded that the average monthly cell phone bill differs from $73.00? Question 24 (2.63 points) Which test are you running? One mean z-test Chi-Square Goodness of...