Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a C++ program to input a number from user and check whether given number is even or odd using functions.


Write a function arraylist which receives an array of integer values. The list of elements are

the following:

20, 40, 60, 80

50, 90, 70, 10

30, 100, 200, 300


Use the concepts of object-oriented programming to develop a program that constitutes the following two classes:



Student-stores student number and surname




Result-contains the marks obtained in two subjects, inherits student details from Student and also uses the method from Student.The program should calculate the average degree mark from the two subjects and display the student details and the total of the marks obtained in each subject.

You need to submit the code and program output

Q1. you will write a program that uses a for statement to calculate and display the sum of all odd numbers between 6 and 27 inclusive on the screen. 


Q2. Write statements that assign random integers to the variable n in the following ranges: Use the random function to generate the numbers. Put the statements in a C++  Program and run it.


  1. a) 1 ≤ n ≤ 54
  2. b) 1 ≤ n ≤ 910
  3. c) 0 ≤ n ≤ 194
  4. d) 1000 ≤ n ≤ 3125
  5. e) –19 ≤ n ≤ 31

An array containing 10 predefined double values are already provided for you in the code editor. Print each of the element out in separate lines, starting from the last array element down to the first.


Each outputted value must also only show up to two decimal places.


Output



Multiple lines containing a float number.



5.10


5.50


4.00


4.02


3.00


3.66


2.50


2.20


1.21


1.40

An array containing 5 integer elements is already provided for you in the code editor below.


Print out the cube of the 1st, 3rd, and 5th element of the given array.


Output



Multiple lines containing the cubes of the 3 elements of the given array.



-8


1


27

2. The Ion Realty Sales Corporation would like to have a listing of their sales over the past few months. Write a program that accepts any number of monthly sales amounts. Display the total of the values. Display a report showing each original value entered and the percentage that value contributes to the total. You may prompt the user for the number of values to be inputted.


Write a two class solution that includes data members for the name of the course, current enrollment, and maximum enrollment. Include an instance method that returns the number of students that can still enroll in the course. The To String( ) method should return the name of the course, current enrollment, and the number of open slots. Design your solution using parallel arrays. Declare an array of class objects in your implementation class. Test your application with the following data:


The Ion Realty Sales Corporation would like to have a listing of their sales over the past few months. Write a program that accepts any number of monthly sales amounts. Display the total of the values. Display a report showing each original value entered and the percentage that value contributes to the total. You may prompt the user for the number of values to be inputted.


Take two lists from the user (elements of the lists

separated by space) of

the same size. The first list will contain some names and the second list

will contain roll numbers. Your job is to assign each name

a roll number

from the list containing numbers following the criteria

given below:

Find the sum of the ASCII value of each name and then sort

the names in

descending order based on the sum. Then assign

lowest number to the

the

name that has the highest ASCII value sum as a roll number.


Sample Input 1:


Alan Jack Nancy Jim


10 15 20 50


Sample Output 1:


Nancy's roll number is: 10


Alan's roll number is: 15


Jack's roll number is: 20


Jim's roll number is: 50


LATEST TUTORIALS
APPROVED BY CLIENTS