Write a program to get input from a student for their name, how many subjects they want to register, and the subject name. Your program should only ask to enter the subject name according to the number they provide. (Use loop concept). If they want to register for five subjects, your program should ask for the input for the subject name only five times
For this question, alter the code in question 7, count the total numbers in the list, find the average of the numbers in the list and find how many numbers are in the range of 10 - 30. Print the count of the total numbers, an average of the numbers, and the count of the numbers in the range of 10 - 30
Design a code for inheritance for that consider three classes namely grandfather, father and child. Each one of them has a character data type member. Each class contain a pair of constructor and destructors. The father is derived from the class grandfather. Similarly the class child is derived from class father. The class grandfather is a base class of the class father. The class father is a base class of the class child. The class child is derived from the class father. The class father is intermediate classes that act as a base class as well as derived class. Constructors are executed from the base class to the derived class and destructors are executed from the derived class to the base class.
Write a program to get numbers as input from the user and save them in a list. The program should keep getting the input until they type, Quit. If they typed Quit, it should stop asking for the input and should print the number they have typed.
Write codes that ask the user to write the name in lowercase. If they did not write in lowercase, keep asking them to re-enter the name until they write in lowercase. If they followed as instructed, then print the statement “Entered name is in lowercase”
smartphone_brand = ‘Samsung Galaxy S20’ Write a program to find the number of uppercase, lowercase, and numbers in the value assigned to the variable smartphone_brand above. Make sure to use the loop concept to answer the question.
A worker takes a job for 5 days. His pay for the day 1 is Rs. X, for day 2 is Rs. 2X and so on. Develop a C++ program to find the total salary using inline function.
Practical 3 (The For...Loop or do....while Loop )
Write a program that uses while loops to perform the following steps:
a. Prompt the user to input two integers: firstNum and secondNum
(firstNum must be less than secondNum).
b. Output all odd numbers between firstNum and secondNum.
c. Output the sum of all even numbers between firstNum and secondNum.
d. Output the numbers and their squares between 1 and 10.
e. Output the sum of the square of the odd numbers between firstNum and secondNum.
f. Output all uppercase letters.
Write a program that inputs a character from user and prints whether it is upper case letter, lower case letter, digit or non-letter/non-digit value.
A carpenter wants to make a ladder, but he want to calculate the required wood for it. The distance
between each step is 1 foot. Write a C++ program in which, take the length and width of ladder as input
from user and calculate the required wood. Price of wood is 500 per foot, now calculate the price of
wood as well.
Example:
Input: Output:
Enter the length of ladder in foot: 25
Enter the width of ladder in foot: 2
Required wood in foot: 98
Cost of wood is: 49000