1 - Io Statements
1 - Io Statements
1.Welcome Message
"Pine Tree" is a recently launched startup Event Management company. The
company gained a good reputation within a short span because of its highly reliable
service delivery.
Nikhil, the founder of this company wished to take the company’s services to the
next step and decided to design an Event Management System that would let its
Customers plan and host events seamlessly via an online platform. As a part of this
requirement, Nikhil wanted to write a piece of code for his company’s Amphi Event
Management System that will welcome all the Customers who are using it. Help
Nikhil on the task.
Output Format:
Output should display "Welcome to Amphi Event Management System".
Refer sample output for formatting specifications.
Sample Output:
Welcome to Amphi Event Management System
Nikhil, the founder of “Pine Tree” company wished to design an Event Management
System that would let its Customers plan and host events seamlessly via an online
platform.
As a part of this requirement, Nikhil wanted to write a piece of code for his
company’s Amphi Event Management System that will display customized welcome
messages by taking Customers’ name as input. Help Nikhil on the task.
Input Format:
First line of the input is a string that corresponds to a Customer’s name. Assume that
the maximum length of the string is 50.
Output Format:
Output should display the welcome message along with the Customer’s name.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
Program:
#include <stdio.h>
void main()
char customer_name[50];
scanf("%s",&customer_name);
3.Number of events
"Pine Tree" Company has signed up a big time Event Management deal from the
Rotary Youth Club for a Trade Fair organized at Codissia Complex, wherein all
startup companies in the Software industry are demonstrating their latest products
and services and meet with industry partners and Customers.
Amphi Event Management System has to be modified to write a piece of code that
will get the input of the number of events to be hosted for the Fair at Codissia from
its users and display the same. Help the company to accomplish the requirement.
Input Format:
First line of the input is an integer that corresponds to the number of events to be
hosted at Codissia.
Output Format:
Output should display the number of events to be hosted at Codissia.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
void main() {
int a;
scanf("%d",&a);
4.Event Details
Be it a last minute get together, a birthday party or corporate events, the "Pine Tree"
Event Management Company helps you plan and execute it better and faster. Nikhil,
the founder of the company wanted the Amphi Event Management System to get
and display the event details from his Customers for every new order of the
Company.
Write a program that will get the input of the event details like name of the event,
type of the event, number of people expected, a string value (Y/N) telling whether the
event is going to be a paid entry and the projected expenses (in lakhs) for the event.
The program should then display the input values as a formatted output.
Input Format:
First input is a string that corresponds to the name of the event. Assume the
maximum length of the string as 50.
Second input is a string that corresponds to the type of the event. Assume the
maximum length of the string as 50.
Third input is an integer that corresponds to the number of people expected for the
event.
Fourth input is a character that corresponds to Y/N telling whether the event is going
to be a paid entry or not.
Fifth input is a double value that corresponds to the projected expenses (in lakhs) for
the event.
Output Format:
Output should display the event details as given in the sample output.
All double values need to be displayed correct to 1 decimal place
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
Sample Input and Output:
Enter the name of the event
Food Fest 2017
Enter the type of the event
Public
Enter the number of people expected
5000
Is it a paid entry? (Type Y or N)
N
Enter the projected expenses (in lakhs) for this event
5.7
Event Name : Food Fest 2017
Event Type : Public
Expected Count : 5000
Paid Entry : N
Projected Expense : 5.7L
#include <stdio.h>
#include<string.h>
#include<stdlib.h>
void main()
char str1[50],str2[50];
int p;
double l;
char y;
gets(str1);
gets(str2);
fflush(stdin);
printf("\nEnter the number of people expected\n");
scanf("%d",&p);
scanf("%s",&y);
scanf("%lf",&l);
6.Trade Fair
Trade Fairs are important for companies to present their products and to get in touch
with its customers and business parties. One such grandeur Trade Fair Event was
organized by the Confederation of National Large Scale Industry.
Number of people who attended the event on the first day was x. But as days
progressed, the event gained good response and the number of people who
attended the event on the second day was twice the number of people who attended
on the first day. Unfortunately due to heavy rains on the third day, the number of
people who attended the event was exactly half the number of people who attended
on the first day.
Given the total number of people who have attended the event in the first 3 days,
find the number of people who have attended the event on day 1, day 2 and day 3.
Input Format:
First line of the input is an integer value that corresponds to the total number of
people.
Output Format:
First line of the output should display the number of attendees on day 1.
Second line of the output should display the number of attendees on day 2.
Third line of the output should display the number of attendees on day 3.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
8.Tile Game
Output Format:
First line of the output should display the number of hours Justin has worked during
the weekdays.
Second line of the output should display the number of hours Justin has worked
during the weekends.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
Sample Input and Output:
Enter the total salary paid
2750
Number of weekday hours is 25
Number of weekend hours is 15
The Magic Castle, the home of the Academy of Magical Arts at California has
organized the great ‘WonderWorks Magic Show’. 3 renowned magicians were invited
to mystify and thrill the crowd with their world’s spectacular magic tricks. At the end
of each of the 3 magicians’ shows, the audience were requested to give their
feedback in a scale of 1 to 10. Number of people who watched each show and the
average feedback rating of each show is known. Write a program to find the average
feedback rating of the WonderWorks Magic show.
Input Format:
First line of the input is an integer value that corresponds to the number of people
who watched show 1.
Second line of the input is a float value that corresponds to the average rating of
show 1.
Third line of the input is an integer value that corresponds to the number of people
who watched show 2.
Fourth line of the input is a float value that corresponds to the average rating of show
2.
Fifth line of the input is an integer value that corresponds to the number of people
who watched show 3.
Sixth line of the input is a float value that corresponds to the average rating of show
3.
Output Format:
Output should display the overall average rating for the show. Display the rating
correct to 2 decimal places.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
Sample Input and Output:
Enter the number of people who watched show 1
400
Enter the average rating for show 1
9.8
Enter the number of people who watched show 2
500
Enter the average rating for show 2
9.6
Enter the number of people who watched show 3
100
Enter the average rating for show 3
5
The overall average rating for the show is 9.22
11.Birthday Challenge
Louis was celebrating his 10th Birthday and his parents wished to make his birthday
more special by throwing a surprise bash, inviting all their friends, relatives and
neighbors. The little mathematics geek Louis has another surprise waiting for him
when he had to cut his favorite Choco vanilla cake. The cake is a rectangular cake
and it consists of m×n (1≤m, n≤1000) squares. His friends now called him out for a
challenge.
The challenge is that, Louis has to break the cake up into 1×1 pieces (individual
squares) and find what is the minimum number of times that he breaks the choco
vanilla cake, or pieces thereof, in order to achieve this?
Note that he cannot stack pieces of the cake and break them, because the choco
vanilla cake is thick. As an example, a 2×2 cake requires 3 breaks. First he can
break it in half, then break each of the halves in half. He cannot break it in half, stack
the two 1×2 pieces, and then use only one more break to achieve his goal.
Input Format:
First line of the input consists of an integer, the dimensions m of the choco vanilla
cake.
Second line of the input consists of an integer, the dimensions n of the choco vanilla
cake.
Output Format:
Output the minimum number of times that he breaks the choco vanilla cake
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]
12.Lucky Gifts
"Planet Kids Entertainment Fair" is back to delight kids and parents. The Fair will
have non-stop entertainment with an extravaganza of games, exciting rides, sports,
art & crafts, role-plays, inspiring competitions, prizes & gifts, and yummy food.
Few lucky attendees at the Fair will be given a pack of candies as a lucky gift and
the show coordinator has assigned you the task for choosing the number of
attendees who will receive the pack of candies. There are 'N' candies available and
you need to decide how many candies to place in each pack. Each pack must
contain the same number of candies. You should choose an integer A between 1
and N, inclusive, and place exactly A candies into each pack. You should make as
many packs as possible but since you enjoy eating candies very much, you eat the
remaining candies.
Write a program that will calculate the maximum number of candies per pack that
can be made with 'N' candies so that you can also maximise the number of candies
that you can eat.
Input Format:
The first and only line of input contains an integer N.
Output Format:
Output a single line that gives the maximum number of candy packs that can be
made with 'N' candies.
Refer sample input and output for formatting specifications.
Sample Input 1:
2
Sample Output 1:
2
Sample Input 2:
5
Sample Output 2:
3
Pranav, an enthusiastic kid visited the "Fun Fair 2017" along with his family. His
father wanted him to purchase entry tickets from the counter for his family members.
Being a little kid, he is just learning to understand about units of money. Pranav has
paid some amount of money for the tickets but he wants your help to give him back
the change of Rs. N using minimum number of rupee notes.
Consider a currency system in which there are notes of seven denominations,
namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If the change given to Pranav
Rs. N is input, write a program to computer smallest number of notes that will
combine to give Rs. N.
Note:
Refer to problem specifications.
Input Format:
First line of the input is an integer N, the change to be given to Pranav.
Output Format:
Output should display the the smallest number of notes that will combine to give N.
Refer sample input and output for formatting specifications.
Sample Input 1:
1200
Sample Output1:
12
Sample Input 2:
242
Sample Output2:
7
15.Talent Show
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.
Input Format:
First line of the input is an integer 'x', which corresponds to the count of girls more
than adults.
Output Format:
Output the total number of people who had visited the talent show.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]