Questions: 9 913

Answers by our Experts: 9 913

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

  1. make the program run on your computer. Understand the logic of functions.
  2. Make changes in the program to sort data in descending order by mergesort and quicksort.
  3. Declare a list object D of size 50 and try your program on this object.

One dimensional Array.


The program will ask the user to input size of the array, and the user will input values for each index.The program will output the LARGEST inputted value and its index.


Ten students had worked in a clothing store during the holidays. At the end of

the holiday, they receive a wage according to the number of items that they

sold. The rate of pay is R6.50 per item. Enter the student name and the

number of items that the student sold during the holidays and display the

student name and the amount earned by every student. Also calculate and

display the student name of the student who sold the most items.



Write a function Lagrange_interp which implements Lagrange interpolation to find data at an intermediate data point. Note: The degree of the polynomial will not be known to you unless the problem statement is given. The function should be able to deal with N data points. You can either use dynamic memory allocation for data storage in arrays or in a simpler approach, you may declare the array sizes as a large value.

Write a program which will do the following:

Create a class called

Triangle

. The three sides of the triangle

are private

members of the class. The

class should contain a member f

unction to determine whether a

triangle is equilateral, isosceles or

scalene.

The class

should

also

include member functions which will give area and perimeter of the

triangle. The side

s of the triangle should be taken as input from the user in the main function.



A. With the use of a suitable diagram explain how a person can get an electrical shock from touching an unearthed isolator. State ONE (1) precaution that can be taken to prevent a reoccurrence

Implement this program by using User-defined functions and Structures


Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and 100), and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType.


Your program must contain at least the following functions:

1. A function to read the students’ data into the array.

2. A function to assign the relevant grade to each student.

3. A function to find the highest test score.

4. A function to print the names of the students having the highest test score.


Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100


Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between (and including) 0 and 9


Listing 102

by CodeChum Admin

We've already made listing an array the easy way, but how about listing and printing the array in reverse order?


Make a program that will input an integer and then using loops, add items on an array/list one by one for the same number of times as that of the first inputted integer. Then, print out the array/list in ascending order. After doing that, print the array again on the next line in reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.


Input

The first line contains the size of the array.

The next lines contains the items of the array (integers).

5
1
64
32
2
11

Output

The first line contains the elements of the array printed in ascending order.

The second line contains the elements of the array printed in reversed order.

1·64·32·2·11
11·2·32·64·1
LATEST TUTORIALS
APPROVED BY CLIENTS