Showing posts with label i-Assess I/O Statements. Show all posts
Showing posts with label i-Assess I/O Statements. Show all posts

Thursday, October 17, 2019

                                                                          E-BOX                                                               

                               BASICS OF C PROGRAMMING                                            

I/O Statements,Operators And Expressions :-  i-Assess

PROGRAM -2 :

PROBLEM

CHANGE POSITION

Change Position

The room that Patrick and Johnny were staying was very big. They felt lazy to walk inside the room from the bed's location to another location. So they wanted to change the position of the bed. The shape of the room is a Square. They decided to place the bed at the centre of the room so that their walking distance would be minimised. Can you please help them in placing the bed at the centre?

                                                                                       

Given the coordinates of the left bottom vertex of the square room and the length of the side, you need to write a program to determine the coordinates of the centre of the room.

[Assumption --- Length of the side is always even]
 

Input Format:

Input consists of 3 integers. The first integer corresponds to the x-coordinate of the left bottom vertex. The second integer corresponds to the y-coordinate of the left bottom vertex. The third integer corresponds to the length of the square.

Output Format:

Refer Sample Input and Output for exact formatting specifications.
 

Sample Input and Output:

[All text in bold corresponds to input and the rest corresponds to output]

Enter the x-coordinate of the left bottom vertex

10

Enter the y-coordinate of the left bottom vertex

30

Enter the length of a side

16

The centre of the room is at (18,38)


SOLUTION : 



Wednesday, October 16, 2019

                                                                             E-BOX                                                               

                              BASICS OF C PROGRAMMING                                            

I/O Statements,Operators And Expressions :-  i-Assess

PROGRAM - 1 :  

PROBLEM

CALCULATING GAIN PERCENTAGE

Calculating Gain Percentage

Vikram buys an old scooter for Rs. A and spends Rs. B on its repairs. If he sells the scooter for Rs. C , what is his gain %?

Write a program to compute the gain %.

 

Input Format:

The first input is an integer which corresponds to A. The second input is an integer which corresponds to B. The third input is a float which corresponds to gain %.

Output Format:

Refer sample input and output for formatting specifications.

The float values are displayed correct to 2 decimal places.

Sample Input and Output:

[All text in bold corresponds to input and the rest corresponds to output]


Price of old scooter:

4700

Repair amount:

800

Selling price:

5800

Gain percentage is 5.45

 SOLUTION :




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

https://amzn.to/2LAmadv