ITC Practice Questions
These are practice problems for ITC and not any assignments. However if any student have not submitted any previous assignment , or have secured less marks. He can submit this assignment in Hard Format in my office on this Monday (Hard Copy should consist of codes and Out put snap shots )
Q1 . Keeping track of and converting between US fluid quantities can be quite confusing and challenging, given all those tablespoons, ounces, quarts, etc. The relationships between all of these fluid units are:
1 fluid ounce = 2 tablespoons
1 gill = 4 fluid ounces (fl oz)
1 cup = 2 gills
1 pint = 2 cups
1 quart = 2 pints
1 gallon = 4 quarts
1 barrel = 42 gallons
Write a program that asks the user to input a number of fluid ounces. Allocate the fluid ounces into the various units,
Q2. When you are calling your friends who live in different cities around the world, it would be helpful to know what time it is where they live. Otherwise you might end up calling and waking them in the middle of the night. Below are the time differences between Philadelphia and several cities around the world.
| Honolulu | -6 hours |
| Seattle | -3 hours |
| London | +5 hours |
| Moscow | +8 hours |
| Hong Kong | +12 hours |
| Aukland | +17 hours |
Write a program that asks the user to input the current time in Philadelphia in military format (e.g.: 0900, 1730), and outputs the current time in the cities listed above.
Q3. Write a program that reads in the coordinates of two points, computes the slope of the line through the two points, and outputs the message “Negative slope”, “Zero slope”, “Positive slope” or “Infinite slope” depending upon whether the slope is negative, zero, positive or infinite.
Q4. Write a program that ask user for 5 input and displays results like . Make sure you add proper space . you may use any escape sequence .
Q5. According to Al Chemiz the amount of gold you can produce from x amount of air (cubic feet), y amount of water (gallons), z number of worms, i amount of wood (pounds) boiling at t temperature (celsius) is given by the following formula:
Q6. Make a function that can covert any word in to a secret code. The code is given below
| Input | Output | Input | Output |
| A | @ | O | N |
| B | A | P | P |
| C | B | Q | Q |
| D | C | R | R |
| E | D | S | S |
| F | E | T | T |
| G | F | U | U |
| H | G | V | V |
| I | H | W | W |
| J | I | X | X |
| K | J | Y | Y |
| L | K | Z | Z |
| M | L | ||
| N | M |
Do not use if else or switch statement or ternary operator. The user need to enter 6 letter words
Q7. Write a program that prompts the user for three integers and print 1 if the integers are in ascending order and 0 otherwise
Write a program that ask user to enter time in hours and minutes
User have to give us three inputs .
Format Hours Minutes
If format = 0 , user must enter time in 12 hour format
Example :
Format Hours Minutes
0 12 30 display message “correct time”
0 17 20 (This is wrong input) display message “wrong time”
If format = 1 , user must enter time in 24 hours Format
Format Hours Minutes
1 22 30 display message “correct time”
1 28 30 display message “wrong time”
Q9. The Gregorian calendar, the current standard calendar in most of the world, adds a 29th day to February in all years evenly divisible by 4,. Write a program that prompts the user for a year and prints either “leap year” or “not leap year” according to the above rule.
Q10.
Make a program that ask user two enter two number can display out put like this .
Lets suppose user have enter 17 and 38 . the out put should be like this

First published on fatsup.wordpress.com ↗

