Lms Test (12th To 17th August)
Lms Test (12th To 17th August)
An Event Management
System should estimate the total expenses incurred by an event and the percentage rate of each
of the expenses involved in planning and executing an event. Nikhil, the founder of "Pine
Tree" wanted to include this functionality in his company’s KL Event Management System
and requested your help in writing a program for the same.
The program should get the branding expenses, travel expenses, food expenses and logistics
expenses as input from the user and calculate the total expenses for an event and the
percentage rate of each of these expenses.
#include<stdio.h>
int main()
{
int be,te,fe,le;
float b,t,f,l,t1;
printf(“Enter branding expenses\n”);
scanf(“%d”,&be);
printf(“Enter travel expenses\n”);
scanf(“%d”,&te);
printf(“Enter food expenses \n”);
scanf(“%d”,&fe);
printf(“Enter logistics expenses\n”);
scanf(“%d”,&le);
t=be+te+fe+le;
b=(float)((be*100)/t);
t1=(float)((te*100)/t);
f=(float)((fe*100)/t);
l=(float)((le*100)/t);
printf(“Total expenses : Rs.%.2f”,t);
printf(“Branding expenses percentage : %.2f%”,b);
printf(“Travel expenses percentage : %.2f%”,t1);
printf(“Food expenses percentage : %.2f%”,f);
printf(“Logistics expenses percentage : %.2f%”,l);
return 0;
}
Sample Input :
242
Sample Output:
7
HillTown Inn is planning to organize a Food Festival bringing together at one place, a wide
variety of cuisines from across the world on account of Christmas. The Hotel Management has
rented out a square hall of an indoor Auditorium for this extravaganza. The side of the square
hall is y inches in which a large square table is placed for the display of the most popular and
celebrated food items. The side of the square table is x inches, such that x<y.
The Management wanted to fill the remaining floor area with a decorative carpet. To get this
done, they needed to know the floor area to be filled with the carpet. Write a program to help
the Management find the area of the region located outside the square table, but inside the
square hall.
#include<stdio.h>
int main()
{
int x,y,z;
printf(“Enter the side of the square hall\n”);
scanf(“%d”,&x);
printf(“Enter the side of the square table place for display\n”);
scanf(“%d”,&y);
z=(x*x)-(y*y);
printf(“Area to be decorated is %d”,z);
return 0;
}
Mountain View Middle School is all set for organizing their elaborate talent show event of the
year, "Stars Onstage". It is a fun-filled event for the students to showcase and build their
confidence.
Of the total audience who had come for the show, 1/3 were boys, 3/6 were girls and the rest of
them were adults. If there were 'x' more girls than adults, how many people were there in
total? Help the School authorities to find the total people who visited their show.
#include<stdio.h>
int main()
{
int x,t;
printf(“Enter x\n”);
scanf(“%d”,&x);
t=x*3;
printf(“%d people were there in total”,t );
return 0;
}
A recently launched attraction at the "Events Square" entertainment fair is the "Carnival of
Terror" which is an interactive fun zone featuring scary, horror and Halloween stories.
The Entry tickets for the show is to be printed with a Welcome message along with an
additional message for Children stating they should be accompanied by an adult. Given the
age of the person visiting the scary house, the ticket should carry the additional message only
for Children whose age is less than 15 years. The show organizers wanted your help to
accomplish this task. Write a program that will get age as the input and display the appropriate
message on the tickets.
#include<stdio.h>
int main()
{
int age;
scanf(“%d”,&age);
if(age>=15)
printf(“Welcome to the show”);
else
printf(“Welcome to the show\n” “please note that you should be accompanied by an adult\n”);
}
Sample Input 1:
20
Sample Output 1:
Welcome to the show
Sample Input 2:
14
Sample Output 2:
Welcome to the show
Please note that you should be accompanied by an adult
"FantasyKingdom" is a brand new Amusement park that is going to be inaugurated shortly in
the City and is promoted as the place for breath-taking charm. The theme park has more than
30 exhilarating and craziest rides and as a special feature of the park, the park Authorities has
placed many Ticketing Kiosks at the entrance which would facilitate the public to purchase
their entrance tickets and ride tickets.
The Entrance Tickets are to be issued typically based on age, as there are different fare for
different age groups. There are 2 types of tickets – Child ticket and Adult ticket. If the age
given is less than 15, then Child ticket is issued whereas for age greater than equal to 15, Adult
ticket is issued. Write a piece of code to program this requirement in the ticketing kiosks.
#include<stdio.h>
int main()
{
int age;
scanf(“%d”,&age);
if(age>=15)
printf(“Adult Ticket\n”);
else
printf(“Child Ticket\n”);
}
Sample Input 1:
20
Sample Output 1:
Adult Ticket
Sample Input 2:
12
Sample Output 2:
Child Ticket
The much awaited event at the entertainment industry every year is the "Screen Awards". This
year the event is going to be organized on December 25 to honour the Artists for their
professional excellence in Cinema. The Organizers has this time decided to launch an online
portal to facilitate easy booking of the Award show’s tickets.
They specifically wanted to provide an option for bulk booking in the portal, wherein there are
many discounts announced. Write a program to help the Organizers to create the portal as per
the requirement given below.
Given the ticket cost as 'X'.
If the number of tickets purchased is less than 50, there is no discount.
If the number of tickets purchased is between 50 and 100 (both inclusive), then 10% discount
is offered.
If the number of tickets purchased is between 101 and 200(both inclusive), 20% discount is
offered.
If the number of tickets purchased is between 201 and 400(both inclusive), 30% discount is
offered.
If the number of tickets purchased is between 401 and 500(both inclusive), 40% discount is
offered.
If the number of tickets purchased is greater than 500, then 50% discount is offered.
#include<stdio.h>
int main()
{
int ct,tp;
float Total,te;
scanf(“%d”,&ct);
scanf(“%d”,&tp);
Total=ct*tp;
if(tp<50)
printf(“%.2f”,Total);
else if(tp>=50 && tp<=100)
{
Te=Total-(10*Total)/100;
printf(“%.2f”,te);
}
else if(tp>=101 && tp<=200)
{
Te=Total-(20*Total)/100;
printf(“%.2f”,te);
}
else if(tp>=201 && tp<=400)
{
Te=Total-(30*Total)/100;
printf(“%.2f”,te);
}
else if(tp>=401 && tp<=500)
{
Te=Total-(40*Total)/100;
printf(“%.2f”,te);
}
else
{
Te=Total-(50*Total)/100;
printf(“%.2f”,te);
}
}
Sample Input 1:
100
5
Sample Output 1:
500.00
Sample Input 2:
100
300
Sample Output 2:
21000.00
. "Zebra Kingdom" is a brand new Amusement park that is going to be inaugurated shortly in
the City and is promoted as the place for breath-taking charm. The theme park has more than
30 exhilarating and thrilling rides and as a special feature of the park, the park Authorities
have placed many Booking Kiosks at the entrance which would facilitate the public to
purchase their entrance tickets and ride tickets.
There are few rides in the park that are not suitable for children and aged people, hence the
park Authorities wanted to program the kiosks to issue the tickets based on people’s age. If the
age given is less than 15 (Children) or greater than 60 (Aged), then the system should display
as "Not Allowed", otherwise it should display as "Allowed".
#include<stdio.h>
int main()
{
int n;
scanf(“%d”,&n);
if(n<15 || n>60)
{
printf(“Not Allowed\n”);
}
else
{
printf(“Allowed”);
}
return 0;
}
Sample Input 1:
20
Sample Output 1:
Allowed
Sample Input 2:
12
Sample Output 2:
Not Allowed