We want to calculate the total marks of each student of a class in Physics, Chemistry and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically.
Hey I’ve got this cool idea for an app! It’s kind of simple but just hear me out. All the user has to do is enter a bunch of integers. Then the application prints the largest sum of a strictly ascending sequence of the array. A strictly ascending sequence is a sequence where the current number is always lesser than the next number.
For example, the user enters 2 4 5 1 7 3, the output should be 11 (2 + 4 + 5).
Then that’s it! I think this is going to be a hit! Don’t you think? Well I do. If you help me then we’re going to be rich!
Note: For this problem, a sequence must contain at least 2 numbers. If there is no sequence found, then the largest sum is 0.
Output:
Enter the size: 6
Enter element #1: 2
Enter element #2: 4
Enter element #3: 5
Enter element #4: 1
Enter element #5: 7
Enter element #6: 3
Largest sum = 11Given the number of people attending a pizza party, output the number of needed pizzas and total cost. For the calculation, assume that people eat 2 slices on average and each pizza has 12 slices and costs $14.95.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
System.out.printf("Cost: $%.2f\n", cost);
Ex: If the input is:
4the output is:
Pizzas: 1
Cost: $14.95Hint: Use the ceil() method to round up the number of pizzas so that enough pizzas are ordered.
Write a program to reverse an integer
Write a program in c++ and implement all basic operation (create new node, search element in list, delete from list etc) in doubly linked list
A python program to print Sum of all prime and non prime numbers in a given range
Draw a flowchart from this algorithm.
Start
Declare variable kilowattHour
Declare variable amountDue
Declare variable i
for i=1 to 100 Step 1
Read kilowattHour from the user
if kilowattHour<=300 then
amountDue=kilowattHour*25.00
else
amountDue=300*25.00+(kilowattHour-300)*30.00
End if
Display amountDue
end for
Stop
Input - 8, Output - 21
Write an algorithm to make a list like 1,1,2,3,5,8,13,21 so when input 8 is entered it should give output 21.(NA)