Question #106535

Make an algorithm for a program that reads two integers each state the length of telephone conversation per second and the area code (1, 2, or 3) which contacted, and calculates the cost of telephone conversations in rupiah, and displays on screen, with the talk rate per second for each region being
a. wilayah 1 = Rp. 100,00 / detik
b. wilayah 2 = Rp. 200,00 / detik
c. wilayah 3 = Rp. 300,00 / detik

Expert's answer

Algorithm:

while(true):
	int conversationDuration = Read("Edit conversation length in seconds:\n");
	int areaCode = Read("Edit area code number:\n");
	int koeff= 0;
	if(areaCode == 1):
		koeff = 100;
	if(areaCode == 2):
		koeff = 200;
	if(areaCode == 3):
		koeff = 300;
	Display(koeff*conversationDuration );

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!

LATEST TUTORIALS
APPROVED BY CLIENTS