Zyan wants to allow visitors of his new website to input and send the bid amounts of antiques shown. He likes to not let them send him any amount less than the base amount he set of Rs.5000. He thinks that the user should have to write the amount again until they write the right amount. Help Adeel setup such a system.
Jonathan is competing to be the class CR on a voting basis. Write a program to help count the number of positive and negative votes he received. The program should terminate if a student enters 0 instead of n or p.
Sample:
Enter your choice(p/n): p
Enter your choice(p/n): p
Enter your choice(p/n): n
Enter your choice(p/n): n
Enter your choice(p/n): p
Enter your choice(p/n): 0
The positive votes are: 3
The negative votes are: 2
Write a program to print the names of students by creating a Student class. If no name is passed while creating an object of Student class, then the name should be "Unknown", otherwise the name should be equal to the String value passed while creating object of Student class.
A thermometer is removed from a room where the
temperature is 70° F and is taken outside, where the air
temperature is 10° F. After one-half minute the thermometer reads 50° F. What is the reading of the thermometer at t 1 min? How long will it take for the
thermometer to reach 15° F?
A thermometer is removed from a room where the temperature is 70° F and is taken outside, where the air temperature is 10° F. After one-half minute the thermometer reads 50° F. What is the reading of the thermometer at t 1 min? How long will it take for the thermometer to reach 15° F?
Take an array of size 5x5 and initialize it with random numbers of range 1 to 10, now add all the elements of the 2D array and display sum.
Modify part a in such a way that you have to find individual sum of each row of the 2D array and store corresponding result in 1D array i.e. sum of all the elements of row 0 should be stored in 1st element of 1D array, similarly sum of all elements of the second row of 2D array should be stored at the second
index of 1D array. Display the final sum array (i.e. 1D array). Think about the size of 1D array yourself.
Example:
Array:
2 3 5 3 1
4 5 1 2 1
4 7 3 2 0
2 1 1 5 1
1 7 8 9 0
Sum array:
14 13 16 10 25
Perform sum of all the elements of the arrays whose row number and column number both are odd. Display the final sum.
Array:
2 3 5 3 1
4 5 1 2 1
4 7 3 2 0
2 1 1 5 1
1 7 8 9 0
Sum: 13
We have a 4 x 4 two dimensional array. Fill it with random values from 1 to 100. Write a code to take transpose of the matrix. The following array is shown as an example:
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
BECOMES
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
Create an array of size 5x5 first fill the array with random values between 1 and 100, print it in straight and reverse order. Then fill that array from the user, print it in straight and reverse order.
Create an array of size 10 fill the array from the user. Then ask the user for the order of sorting ascending or descending. And sort the array using bubble sorting algorithm.
Off-road motorbike racing can be dangerous, especially when it rains. It has been found that it rains during
18% of races. When it does not rain, there is a 5% chance that Dwayne (a rider) will get hurt. However, when it
rains, the chance that he gets hurt increases to 35%. Dwayne has just finished a race and is hurt. What is the
probability that it rained during the race?