Saturday, December 7, 2019

                                                 E-BOX    

                                              BASICS OF C PROGRAMMING   

 i - Design


Conditional Statements :-  Programming 

 PROBLEM - 8 

S2P8-TOTAL EXPENSES

Total Expenses

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.
 
Input Format:
First line of the input is an integer that corresponds to the cost of the ticket ‘X’.
Second line of the input is an integer that corresponds to the number of tickets purchased.

Output Format:
Output should display a double value, which gives the total expenses in purchasing the tickets after discounts. Display the output correct to 2 decimal places.
Refer sample input and output for formatting specifications.

Sample Input 1:
100
5

Sample Output 1:
500.00

Sample Input 2:
100
300

Sample Output 2:
21000.00


SOLUTION :















                                      E-BOX    

                                 BASICS OF C PROGRAMMING   

i - Design


Conditional Statements :-  Programming 

 PROBLEM - 7

S2P7-TICKET TYPES

Ticket types
 

The Magic Castle, the home of the Academy of Magical Arts at California has organized the great 'WonderWorks Magic Show'. Renowned magicians were invited to mystify and thrill the crowd with their world’s spectacular magic tricks. The Ticket booking for the show started 2 days prior and there were different types of tickets offered with different fare. The show organizers wanted to place a scanning machine at the entrance of the venue for scrutiny. The machine will take the input of a character denoting the various ticket types and displays the equivalent ticket type of the given character.
 
There are 5 types of tickets, each of which is denoted by a character (both upper case and lower case). Please find the equivalent strings for the characters.
E or e - Early Bird Ticket
D or d - Discount Ticket
V or v - VIP Ticket
S or s - Standard Ticket
C or c - Child Ticket
Write a piece of code for the scanning machine that will take the input of a character and print the equivalent string as given.


Note:
Refer to problem specifications.

Input Format:
The first line of the input is one of the character that denotes one of ticket types.

Output Format:
Output should display the equivalent ticket type of the character.
Refer sample input and output for formatting specifications.

Sample Input 1:
e

Sample Output 1:
Early Bird Ticket

Sample Input 2:
S

Sample Output 2:
Standard Ticket


Problem Requirements:

C

KeywordMin CountMax Count
switch11



SOLUTION :





















Friday, December 6, 2019

                                       E-BOX    

                                  BASICS OF C PROGRAMMING   

i - Design


Conditional Statements :-  Programming 

 PROBLEM - 6

S2P6-TRIANGLE GAME

Triangle Game
 

The Westland Game Fair is the premier event of its kind for kids interested in some intellectual and cognitive brain games. Exciting games were organized for kids between age group of 8 and 10. One such game was called the "Triangle game", where different number boards in the range 1 to 180 are available. Each kid needs to select three number boards, where the numbers on the boards correspond to the angles of a triangle.
 
If the angles selected by a kid forms a triangle, he/she would receive Prize 1. If the angles selected by a kid forms a right triangle, he/she would receive Prize 2. If the angles selected by the kids form an equilateral triangle, he/she would receive Prize 3. If the angles selected by a kid do not form even a triangle, then he/she will not receive any prizes. Write a program for the organizers to fetch the result based on the number boards selected by the kids. 

 

Input Format:
There are 3 lines in the input, each of which corresponds to the numbers on the boards that the kids select.
 
Output Format:
Output should display "Prize 1" or "Prize 2" or "Prize 3" or "No Prize" based on the conditions given.
Refer sample input and output for formatting specifications.

Sample Input 1:
60
50
70

Sample Output 1:
Prize 1

Sample Input 2:
60
60
70

Sample Output 2:
No Prize


SOLUTION :



Wednesday, December 4, 2019

                                   E-BOX    

                              BASICS OF C PROGRAMMING   

 i - Design


Conditional Statements :-  Programming 

PROBLEM-5

S2P5-CARD GAME
                                                
                                                                    Card Game
 

The Westland Game Fair is the premier event of its kind for kids interested in some intellectual and cognitive brain games. Alan, a middle school boy is visiting the fair where he is very much drawn by the Card game.

The game’s rules are:
A player needs to pick 3 cards from a big lot of cards. There are 4 types of Cards namely Spade(S), Heart(H), Club(C) and Diamond (D). If all the 3 cards that the player picks are of the same type and same number, they get a Double Bonanza. If all the 3 cards are of the same type or if they all have the same number, they get a Bonanza. Otherwise they do not get a Bonanza. Alan has now picked 3 cards and is awaiting to know if he has got a bonanza. Please help him to know if he has won the Bonanza or not.

 
Input Format:
There are 3 lines of input.
Each of the line consists of character and integer input, which corresponds to the type of the card and the number in it that Alan picked. The type of card and the number are separated by a single space.
 
Output Format:
Output should display "Double Bonanza" or "Bonanza" or "No Bonanza" based on the conditions given.
Refer sample input and output for formatting specifications.

Sample Input 1:
S 5
S 5
S 5

Sample Output 1:
Double Bonanza

Sample Input 2:
S 6
S 5
H 5

Sample Output 2:
No Bonanza


SOLUTION:



                                      E-BOX    

                                BASICS OF C PROGRAMMING   

i - Design


Conditional Statements :-  Programming 

PROBLEM - 4

S2P4-LUCKY WINNER

Lucky Winner
 

It was the inaugural ceremony of "Fantasy Kingdom" Amusement park and the park Management has announced some lucky prizes for the visitors on the first day. Based on this, the visitors whose ticket number has the last digit as 3 or 8, are declared as lucky winners and attracting prizes are awaiting to be presented for them.
Write a program to find if the last digit of the ticket number of visitors is 3 or 8.

 
Input Format:
First line of the input is an integer that corresponds to the ticket number.

Output Format:
Output should display as "Lucky Winner" if the last digit of the ticket number is 3 or 8. Otherwise print "Not a Lucky Winner".
Refer sample input and output for formatting specifications.

Sample Input 1:
43

Sample Output 1:
Lucky Winner

Sample Input 2:
41


Sample Output 2:
Not a Lucky Winner


SOLUTION :



Tuesday, December 3, 2019

                                      E-BOX    

                                 BASICS OF C PROGRAMMING   

i - Design


Conditional Statements :-  Programming

 PROBLEM - 3

S2P3-THRILL RIDE

Thrill ride
 

"Fantasy 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 which 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". Write a block of code to help the Authorities program this functionality.

 
Input Format:
First line of the input is an integer that corresponds to the age of the person opting for the ride.

Output Format:
Output should display "Allowed" or "Not Allowed" based on the conditions given.
Refer sample input and output for formatting specifications.

Sample Input 1:
20

Sample Output 1:
Allowed

Sample Input 2:
12

Sample Output 2:
Not Allowed


SOLUTION :



Monday, December 2, 2019

                                     E-BOX    

                                BASICS OF C PROGRAMMING   

i - Design

Conditional Statements :-  Programming

 PROBLEM - 2

S2P2-TICKET TYPE

Ticket type
 

"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.
 
Input Format:
First line of the input is an integer that corresponds to the age of the person.

Output Format:
Output should display "Child Ticket" or "Adult Ticket" based on the conditions given.
Refer sample input and output for formatting specifications.

Sample Input 1:
20

Sample Output 1:
Adult Ticket

Sample Input 2:
12

Sample Output 2:
Child Ticket


SOLUTION:



Sunday, December 1, 2019

                                      E-BOX    

                                 BASICS OF C PROGRAMMING   

i - Design

Conditional Statements :-  Programming

 PROBLEM -1

S2P1-WELCOME

Welcome
 

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.

 
Input Format:
First line of the input is an integer that corresponds to the age of the person.

Output Format:
Output should display the additional message "Please note that you should be accompanied by an adult" for Children less than 15 years. Otherwise it should print only the Welcome message.
Refer sample input and output for formatting specifications.

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


SOLUTION : 




                                                 E-BOX                                                     BASICS OF C PROGRAMMING       i -...

https://amzn.to/2LAmadv