Answer to Question #315671 in C++ for Nobody

Question #315671

Azeem Telco Sdn. Bhd charges file, contains records for each call made by its subscribers during a month. Each record on a file contains the subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometers) and duration of the call-in seconds.

As a junior programmer, you are required to design and write a complete C++ program that asked the user to enter subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometers) and duration of the call-in seconds. The user also needs to enter types of call either Local or International call.

The cost of each call is calculated based on Table 1.

 Distance from Shah Alam

Less than 25 km

25 <=km<75

75 <=km<300

300 <= km <=1000 Greater than 1000 km

Cost(RM)/minute

Local International 0.35 0.55 0.65 0.85 1.00 1.20 2.00 2.20 3.00 3.20

          Your program should use the following:

1. Appropriate Control Structure

2 User Defined Function



1
Expert's answer
2022-03-22T10:16:28-0400
void Distance(int dist, double internation)
{
	cin >> dist;

	if (dist <= 25 && dist < 75)
	{
		internation = 0.35;
	}
	else if (dist <= 75 && dist < 300)
	{
		internation = 0.55;
	}
	else if (dist <= 300 && dist <= 1000)
	{
		internation = 0.65;
	}
	else if (dist > 1000)
	{
		internation = 0.85;
	}


}
int main()
{
	int d;
	double inter;
	Distance(d, inter);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog