Write a program in c++ to implement the stack push 5 values (10,20,30,40,50,)in the stack them pops value and display the remaining stack value.
Construct a C++ program having base class Student consisting protected member’s student name, student reg, student branch and employee rno. Define a member function input() having void return type for initializing the above said data members. Use this class to create new class Result having data member subject name ,subject marks, total marks and grade that calculate the grade for each course by using marks range given below and print the grade of each course by defining member function output() with void return type. Total marks Grade Calcultion 95-100 ‘O’ 90-94 ‘A+’ 85-89 ‘A’ 80-84 ‘B+’ 70-79 ‘B’ 60-69 ‘C’ 40-59 ‘D’ <40 ‘E'
by CodeChum Admin
In life, good things take time.
Let's make a simple program that mirrors this beautiful idea where we ask the user for two integer inputs. The first one would represent the starting number and the second one would represent the next n integers after it.
For example, if the first number inputted is 2 and the second number inputted is 3, then the output would be 3, 4, 5 because these are the next 3 integers after 2.
Instructions:
Input
1. Starting integer
2. Number of integers
Output
Enter·starting·integer:·2
Enter·how·many·next·integers:·3
3·4·5When should you use a structure?Why?
A . An airline intends to extend its air fleet by purchasing three types of aircrafts, denoted by I, II and III respectively. The available budget is 5000 units. The three types have the following features:
l .costs 100 units, has a range of 6.000 km and the collision avoidance system range is 30 km;
II. costs 60 units, has a range of 4.200 km and the collision avoidance system range is 48 km;
III. costs 50 units, has a range of 2.800 km and the collision avoidance system range is 32 km;
Compute how many aircrafts from each type should be purchased such that
-the budget is not exceeded
-the mean flight range is maximized the mean of
-the collision avoidance system range is at least 40 km.
Q. Solve A using the backtracking algorithm.
Use a while loop to find the smallest integer n such that 3n is greater than 30000
Write a program that displays the following table (note that 1 millimeter is 0.039 inches):
Millimeters Inches
2 0.078
4 0.156
…
96 3.744
98 3.822
Design a base class staff (staffno, name, salary) and two derived classes as teaching staff(subject) and nonteaching staff(post). Write necessary member function to accept and display information of all staff members
Write a program that prompts the user to enter the day number of a week and hours passed, and displays the day and remaining hours. For example, if the user entered day number 2 and hours passed 4, the program should display Today is Monday and Remaining Hours: 20. If the user entered day number 7 and hours passed 12, the program should display Today is Saturday and Remaining Hours: 12
Using a while loop write a program that will ask the user to input 5 positive numbers then the program will calculate the sum Ang display all odd numbers the calculate the sum of all odd and even numbers entered
Sample output:
Please enter 5 positive numbers: 1 14 2 13 3
The odd numbers are: 13 3
The sum of odd numbers is: 16
The sum of all numbers is: 33