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 program that reads in a sequence of characters and prints them in reverse order (Use a stack).


Given an array array[], its starting position l and its ending position r. Sort the array using Bucket Sort algorithm.

Input: N = 10

array[] = {10 9 7 8 6 2 4 3 5 1}

Output: 1 2 3 4 5 6 7 8 9 10 


I want you to make a array of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, on separate lines.



Square to the Next Level

by CodeChum Admin

We've already tried printing out the values of an array in reversed order, right? Today, we shall compute for the squares of all the numbers.


There's already a predefined array/list containing 100 integer values. Loop through each values, compute their squares, and display them.


Output

Multiple lines containing an integer.

4
9
25
10000
49
9
25
9
1
16
.
.
.

Ask user enter number 0-9 and make value of that index

null of above array


Construct a polynomial class (Polynom) to represent polynomials of the form
P=a0+a1x+a2x^2+….+anx^n. Request:

Polynomials with dynamic memory management to hold coefficients (int bac; double *heso)
The coefficients of a polynomial of type double
It is possible to declare a polynomial with a given number of degrees, given array of coefficients.
By default, the polynomial has degree n=0, the coefficients are set to the initial value 0.0 except the last coefficient of order n is 1.0.
Defining the destructor
Has a copy constructor
Polynomial assignment can be performed using the = . sign
Write a main program using the above class

Implement a class Car as described below. A Car shall have a brand, model and mileage. The class Car should have a proper constructor to set the brand and model of a car. A new car should have mileage as 0 km. The class Car provides public method getBrand and getModel to access the car’s brand and model respectively. The class Car provides a public method drive to increment the mileage by 1 km. (10 marks)


Write a main()routine that uses the subroutine that you wrote for part (a) to output 10 lines of stars with 1 star in the first line, 2 stars in the second line, and so on, as shown below. ( 6 marks)

*_*_*_*_*_*_*_*_*_*

*_*_*_*_*_*_*_*_*

*_*_*_*_*_*_*_*

*_*_*_*_*_*_*

*_*_*_*_*_*

*_*_*_*_*

*_*_*_*

*_*_*

*_*


Write a subroutine named "stars" that will output a line of stars to standard output. (A star is the character "*".) The number of stars should be given as a parameter to the subroutine. Use for loop. For example, the command "stars(10)" would output (6 marks) *_*_*_*_*_*_*_*_*_* 


Write pseudo code that print the largest value among a list of numbers. 


LATEST TUTORIALS
APPROVED BY CLIENTS