Computer Science, asked by avinashabhi911, 2 months ago

A video library rents new videos for Rs.75 a day and old movies for Rs.50 a day.

Write a program to calculate the total charge for a customer’s video rentals. The program should prompt the user for the number of each type of video and output the total cost.​

Answers

Answered by topwriters
1

Program in Python to find the video rental charge

Explanation:

Given: A video library rents new videos for Rs.75 a day and old movies for Rs.50 a day.

Find: Write a program to calculate the total charge for a customer’s video rentals. The program should prompt the user for the number of each type of video and output the total cost.​

Solution:

Let's write a program in Python to find the video rental charge.

We need 3 inputs. Number of new videos, old videos and number of days rented.

videos = int(input("Enter the number of new videos: "))

oldies = int(input("Enter the number of oldies: "))

days = int(input("Enter the number of days rented: "))

result = (videos*75) + (oldies*50)

rental = (result*days)

print("The total cost is","INR",rental)

Answered by nidaeamann
1

Explanation:

There are various basic computer programming languages and one of them is the C language, the base of many computer languages.

The program of finding factorial is written below;

PROGRAM

#include<stdio.h>

int main (void)

{

    int i,  

   int factorial =1,

   int input_new;

   int input_old;

   int days;

   int cost

   printf("Enter the number of old movies rented: ");

   scanf("%d",&input_old);

    printf("Enter the number of new movies rented: ");

   scanf("%d",&input_new);

   printf("Enter the number of days rented: ");

   scanf("%d",&days);

  cost = (days x input_new) + (days x input_old)

   printf("Total cost of customer is %d" ,cost);

  return cost;

}

Similar questions