C++ Answers

Questions answered by 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

3. Place Values

by CodeChum Admin

Manipulating values from a series of numbers is fun, but let's try exploring the use of loops a little more.


How about printing out each digit of a number by place values, in ascending order?



Instructions:

  1. Create a variable and input a random positive integer.
  2. Using while loop, print out each digit of the inputted integer in separate lines, starting from its rightmost digit until the leftmost digit of the number. Tip: Use % 10 to get the rightmost digit, and / 10 to remove it from the number.
  3. Another tip: don't forget to consider the case wherein the input is `0`

Input

A line containing an integer.

214

Output

Multiple lines containing an integer.

4
1
2

4. Gathering Positivity

by CodeChum Admin

I always want to look at the positive side of things, so I decide to seriously look at positive numbers, too!


Will you code along with me?



Instructions:

  1. Using the do…while() loop, continuously scan for random integers, but add up only all the positive integers and store the total in one variable.
  2. The loop shall only be terminated when the inputted integer is zero. Afterwards, print out the total of all inputted positive integers.

Input

Multiple lines containing an integer on each.

2
3
4
-1
-5
1
0

Output

A line containing an integer.


10

5. "Even" Now

by CodeChum Admin

I'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.


How about that?


Input

A line containing two integers separated by a space.


3·10

Output

Multiple lines containing an integer.


10
8
6
4

Write a program that will ask a user to input a number n. The program will then display a 

Fibonacci sequence with n as number of displayed sequence. 



Question 6 (40 marks) 200-500 words per explanation and avoid plagiarism.


I. Explain the following in your own words without copying it from anywhere. Give


examples each in your explanation.


a. Class hierarchies b. Algorithms


c. Flowcharts


d. Control structure

Discuss Object oriented programming in c++ with 4 points. Each point shoult not be less


than 200 words.


Question 6 (40 marks) 200-50

Director office requires applications from students for the award of scholarship, Each student required to submit reg no, name, semester and cgpa in the last semester. The form After placed one over the other initially the administration don't know how many student will apply reciving all the applications the administration check each application and formulate a list of students whose copa is more than 3.8. This list contains the student on top who applied first you are required to implement this senarioin C++ Assuming primitive functions are already availatle you have to add required functions only in the class main() function is also not required.



The DSA City tax office solve the tax related problems of their citizens A large number of peopl visit this office on the daily basis. However, beating capacity of the waiting room for the visitors 30 persons Wher the waiting mom gets full no other vialtor is allowed to enter the tax office unti someone leaves The tax office want to automate the process of dealing with customers by issung them tokens for their turn. They have decided to issue the token numbers and process theme increasing fashion that is, a person having the token of lowest value is called first forming the tax office representative.

Your job is to help tax office to implement this APT in C++ A Propose appropriate data structure Write complete class having all required functions, main() function is not required. Add comeent to explain program


100-500 words per explanation and avoid plagiarism. i. Explain the following datatypes in your own words without copying it from anywhere. a. int b. float. c. double. d. string. e. Bool.


Modify the program above so that it displays the message<<<no credits beyond 100>>> if the credit entered is beyond 100

LATEST TUTORIALS
APPROVED BY CLIENTS