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

Create a function which receives a pointer of array as a parameter and calculates the sum of prime

numbers and sum of non_prime numbers in that array. Then compares them to find out which one is

larger (sum of prime or sum of non_prime). Return both sum of prime and sum of non_prime numbers

also and print those in the main function.


Create a function to compare the elements of 2 arrays. Function should receive two pointers to an array

and then check if the elements are same in both arrays or not. If both arrays are same return true,

otherwise false.


Suppose you want to send a message to your friend but don’t want others to understand that message.

So, you have decided to encrypt the message.

Now, suppose the message is in a string variable called MSG. a) You have to encrypt the message and

change the string so that others cannot understand it. b) Again, decrypt the encrypted message.


a)         Method getData: This method reads and stores the data in the two-dimensional list.

 

b)         Method averageHigh: This method calculates and returns the average high temperature of the year.

 

c)         Method averageLow: This method calculates and returns the average low temperature of the year.

 

d)         Method indexHighTemp: This method returns the index of the highest temperature in the list.

 

e)         Method indexLowTemp: This method returns the index of the lowest temperature in the list.


Store the details of the following 3 flights in a 2-dimensional tuple:

Flight number Destination Departure time

EK004 London 12:30

EK012 Paris 14:00

EK052 Male 16:15

Create a function called checkFlightNumber which accepts a flight number as an input parameter. This function will check if the flight number is found in the tuple which contains the flight details and return TRUE of found or FALSE if it is not.

Your program should keep asking for passengers’ (loop)details until the user enters n to stop. The program should first ask for the passengers’ flight number and use the checkFlightNumber function to check if it is valid or not. If checkFlightNumber returns FALSE, your program will print an appropriate error message and ask the user to try again. However, if checkFlightNumber returns TRUE, your program should ask

the user to enter the following passenger details:

1.Name

2.Date of birth

3. Passport number


You are given on array a of n integers on which the followings operations can be performed





Pick an index i,0<= i<n.




Choose any integer p.




Replace a

A bookshop gives discount to customers as follows: • Students get 10% discount, • Book dealers get 12% discount and • Pensioners get 15% discount. • All other customers get 10% discount only if their total purchases are more than R200. You are requested to write two versions of a program that calculates and displays the final amount that is due, after discount. (i) The first version of the program uses a switch statement to implement the above program. (ii) The second version of the program uses nested-if statements. Hint: Use the following variables: float amount; // the amount due before discount char customer Type; // the type of customer: 'S' (student) or // 'D' (dealer) or 'P' (pensioner) or


Include the for loop below in a small program and complete the program. The loop should execute 10 times. Do not change the for loop below. Compile and run your program to see for yourself that it works. You do not have to submit this program and output. for (int i = 1; i <= n; i++) cout << i * i; Now convert the for loop into a while loop and add any variable initialisations that you think are necessary. Compile and run your program and submit only the program containing the while loop and its output


The Computer Science Department follows certain criteria when a student learns to program. A number of programming exercises must be worked through. To proceed to the next exercise a student has to obtain a mark of 50% or more and must have completed 5 or more program runs. You are requested to write a program to validate if a student can proceed to the next program. Your program should have the following structure: Declare two integer variables programs, Done and result. Validate the data captured for the two variables using a while loop. The loop should be repeated until the value of result is greater than or equal to 50 and the value of programs Done is greater than or equal to 5. • Display a message like "Good! You can now proceed to the next exercise" Submit both your program and output


Calculator should be able to handle the five basic mathematics operations – +,-,*and divide and modulus – on two input values. Program should have the following structure: Ask the user to enter two float variables named var1 and var2. Ask the user to enter a character variable named operation to represent the operation to be performed on the two variables. Perform the appropriate operation by using if-statements. The output must be given in fixed-point notation with two digits after the decimal point. A typical run is displayed below: Please enter the first float value: 35.6 Please enter the second value: 24.12 Please enter the operation required : The sum of 35.6 and 24.12 is 59.72 Submit both your program and output.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS