Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The M-F Telephone Company (formally known as the Maxx-Fadia Telephone Company) h

ID: 3603338 • Letter: T

Question

The M-F Telephone Company (formally known as the Maxx-Fadia Telephone Company) has the following rate structure for long distance calls: . Regular rate for a call is $0.10 per minute · Any call started at or after 6:00 PM (1800 hours) but before 8:00 AM (0800 hours) is discounted 50% · Any call longer than 60 minutes receives a 15% discount on its cost (after any other discount is subtracted) All calls are subject to a 4% federal tax on their cost Write a program that Requests the customer account number, customer name, address, city, state, and zip code and how many call the customer made call a method to request that customer's data . o Assumptions account number- always 8 characters name, address, city-max size will be 20 characters state-always 2 characters zip code - always 5 digits (store as string) * o total calls-must be0 · Write a method to print 3 blank lines then display one line containing the customer data from the previous method Using a"for loop" . o for each call the user will enter the start time for the call (based on a 24-hour clock) and the length of the call (use separate methods to obtain these) o Call a method to calculate the gross cost (before any discounts or tax) o Call a method to calculate the net cost (after discounts and tax added) o Call a method to print out: call number (1,2,...), start time, length of the call, gross cost, discount amount, tax amount, and net total o The program will sum the total amount due sum of net total amounts for all calls. Using a "while loop" the user will continue to enter customers until no more to enter (any more customers Write a method to separate customers by a "dashed line." After all customers have been entered call method to print out total amount for all calls made.

Explanation / Answer

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

void main()

{

int a[3][3],i,j,ch,num;

void input(int [][3]);

void print(int [][3]);

void transpose(int [][3]);

void scalar(int [][3],int);

void diagonal(int [][3]);

clrscr();

while(1)

{

clrscr();

printf(" 1. Input the Matrix");

printf(" 2. Print the Matrix");

printf(" 3. Transpose the Matrix");

printf(" 4. Scalar Matrix");

printf(" 5. Dialog Matrix");

printf(" 6. Exit");

printf(" Enter the choice (1-6) - ");

scanf("%d",&ch);

clrscr();

switch(ch)

{

case 1:

input(a);

break;

case 2:

print(a);

break;

case 3:

transpose(a);

break;

case 4:

printf("Enter the scalar number - ");

scanf("%d",&num);

scalar(a,num);

break;

case 5:

diagonal(a);

break;

case 6:

exit(0);

}

}

getch();

}

void input(int a[][3])

{

int i,j;

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

{

printf("Enter the number - ");

scanf("%d",&a[i][j]);

}

}

}

void print(int a[][3])

{

int i,j;

for(i=0;i<3;i++)

{

printf(" ");

for(j=0;j<3;j++)

{

printf("%3d",a[i][j]);

}

}

getch();

}

void transpose(int a[][3])

{

int i,j;

for(i=0;i<3;i++)

{

printf(" ");

for(j=0;j<3;j++)

{

printf("%3d",a[j][i]);

}

}

getch();

}

void scalar(int a[][3],int num)

{

int i,j;

for(i=0;i<3;i++)

{

printf(" ");

for(j=0;j<3;j++)

{

printf("%3d",a[i][j]*num);

}

}

getch();

}

void diagonal(int a[][3])

{

int i,j;

for(i=0;i<3;i++)

{

printf(" ");

for(j=0;j<3;j++)

{

if(i==j)

printf("%3d",a[i][j]);

else

printf("%3d",0);

}

}

getch();

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote