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

4. Arraying 102

by CodeChum Admin

We've already made arraying/listing the easy way, but how about arraying/listing and printing the list 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 reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.


Input


1. Size of the array

2. Elements of the array

Output


The first line will contain a message prompt to input the size of the array.

The succeeding lines will contain message prompts to input the elements of the array.

The next lines will contain the elements of the array in reversed order.


Enter·the·size:·5
Element·#1:·1
Element·#2:·64
Element·#3:·32
Element·#4:·2
Element·#5:·11

Reversed·Order:
Element·#1:·11
Element·#2:·2
Element·#3:·32
Element·#4:·64
Element·#5:·1

1. 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
.
.
.

Make a c++ program that will print the average of the values of the three quizzes using function. The values of the quizzes are input values from the user.


5.20 (Displaying a Rectangle of Any Character)

–Modify the function created in Exercise 5.19 to form the rectangle out of whatever character is contained in character parameter fillCharacter.

–Thus if the sides are 5 and 4, and fillCharacter is "@", then the function should print the following:


Enter a character to fill the rectangle: a


Enter sides: 4 5


a a a a a

a a a a a

a a a a a

a a a a a


Give at least three examples that show different features of string slices. Describe the feature illustrated by each example. Invent your own examples. Do not copy them for the textbook or any other source.


Write a while loop that calculates the sum of the cubes of numbers starting from 1 to 40 (inclusive). That is, the loop prints the foloowing value 1 + 23 +33 + ... +403. Make sure to define any variables you may need.


You need to submit the code and program output.

 

Q1. you will write a C++ program that uses a for statement to calculate and display the sum of all even numbers between 5 and 24 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.


a) 1 ≤ n ≤ 87 


b) 1 ≤ n ≤ 925 


c) 0 ≤ n ≤ 424 


d) 2000 ≤ n ≤ 3138


e) –16 ≤ n ≤ 65




Ask the name and roll number of user and then take two float values from user and perform all arithmetic opertaions on them and print the answers.


Write a C program to implement a basic billing system for a bookshop that accepts book code and book price for 10 books and at the end, display the total price.


Write a program that inputs three integers from the keyboard and prints the sum,


average, product, smallest and largest of these numbers. The screen dialog should


appear as follows:


Input three different integers: 13 27 14


Sum is 54


Average is 18


Product is 4914


Smallest is 13


Largest is 27



LATEST TUTORIALS
APPROVED BY CLIENTS