Question :
Develop a C program to get the temperature and print the following status according to the given temperature by using else if ladder statement.
1. T<=0 "Its very very cold".
2. 0 > T < 10 "Its cold".
3. 10 > T < =20 "Its cool out".
4. 20 > T < =30 "Its warm".
5. T>30 "Its hot".
Testpaper Arrangement in Decreasing Order
A system maintains a set of testpapers and arranges those papers in decreasing order either by registration number or by name.
Develop suitable algorithm and C++ code to create a generic class for maintaining the testpapers and arranging them.
Input format:
Enter the no. of testpapers,n
Enter the registration number of testpaper1
Enter the registration number of testpaper2
…
Enter the registration number of testpapern
Enter the name of testpaper1
Enter the name of testpaper2
Enter the name of testpaper3
Output format:
Registration number arranged in decreasing order (one in each line)
Name arranged in decreasing order (one in each line)
Mr. John needs to deliver goods from Supermarket to customers house in a two-storey apartment. Owner wants to know the location where John has delivered the goods. The total distance from the store to apartment is 400 steps. To go to 2nd Floor, John need to go 25 steps extra. The distance for 1st floor is less than 25 steps.
If John has crossed more than 425 steps then he has delivered in 2nd Floor. If total steps of John is between 400 to 425 then he has delivered in 1st Floor else John has delivered in Ground floor.
A software need to be developed, to check which floor John has delivered the goods.
Following are requirements to solve the problem
a. Capture the number of steps John used after reaching the building.
b. Add with the distance from Store to apartment. i.e., 400+ steps by John.
c. Compare the total distance travel.
d. Display the appropriate result.
Mr. Seth is a Goldsmith. He wants to know the amount of money earned from the sale.
On a Normal day, i.e., Weekday there is a sale of Rs. 10000/- which is fixed. On a weekend, there is an additional sale of Rs. 5000/- , and on a festival day (be it either week day or week end), there is an additional sale of Rs. 20000/-.
Following are requirements to solve the problem
a. The type of day i.e., weekend or festival day has to be captured.
b. Check for the type of day and compute the total amount of sale
c. Display the amount of sale in Rupees.
Mr. Sharma has travel plans. He wants to know the distance ravelled in kilometers [KM] to
destination on October 15th. Initially Mr. Sharma travels a fixed distance of 40 KM from his
house to Airport. If October 15th is a Full working day he travels 2200 KM to attend al
Conference at Delhi. if it is a half working day he travels 350 KM to attend a Conference at l
Chennai. if it is a Holiday he travels 600 KM for a Holiday in Goa.
Following are requirements to solve the problem
a. The working day status i.e. Full working day. half working day or Holiday on October 15th
has to be caplured.
b. Check for the given conditions and compute the total distance
c. Display the distance travelled in KM along with the destination in an appropriate message.
Overload the insertion and extraction operator to take input for the lecturerData class
below. Your operator overload functions should be capable of writing statements that take
multiple inputs and display multiple outputs as below.
lecturerData L1,L2;
cin>>L1>>L2;
cout<<L1<<L2;
class dateType
{
int day,month,year;
};
class lecturerData
{
char firstName[10];
char lastName[10];
int empid;
char designation[10];
dateType DOH;
};
Question 1) Declare and initialize a one dimensional array to hold the numeric index values for each character in your own simulated game theme.
Question 2) Declare and initialize a two dimensional array to hold the textual character attribute data for all characters. Include data for at least two textual attributes per character
Write a Java program to sort an array of given integers using the Bubble sorting Algorithm ????
Write the program using C++
Note: Use the mode to call the functions and store values in the array (value3).
(g) Function Name-PrintReport() which takes two float values and int size as parameters. .
Note: Should use StoreData function already defined to find min, max, total and avg marks.
(h) Create a structure with the fields; subject name, total and avg.
(i) Implement the main method of a C++ program,
Create float arrays with the names subject l , subject 2 and results. The arrays are of size 5.Find and print the highest marks,Lowest,Total,avg of Subject P and Subject Q of each class using the function StoreData().Print the report using the function PrintReport().
Create two structure variables. Each variable should store and print a summary of each Subject, aggregating marks of all 5 classes.
Given a sentence, write a program to rotate words longer than given length L by K letters towards the
right. Note: Even if K is greater than word length, rotate the word multiple times so that K letters will be rotated towards right.
Input
The first line of input will contain a string. The second line of input will contain two space separated integers, denoting L and K.
Output
The output should be a single line containing the sentence by rotating the words whose length is greater than L by K letters towards right.