Questions: 11 448

Answers by our Experts: 10 707

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. A Shorter Three

by CodeChum Admin


Numbers in threes are awesome! But the one last time was too lengthy to look at, so I just want to view it in a shorter but still readable format.




You okay with this task?






Instructions:


Print out all numbers from 1 to 100 that is divisible by 3 using a for loop just like the last problem, but this time, with each number only separated by the space like that of the sample output.

Output


A line containing integers divisible by 3 separated by a space.


3·6·9·12·15·18·21·24·27·30·33·36·39·42·45·48·51·54·57·60·63·66·69·72·75·78·81·84·87·90·93·96·99


3. There was a Three

by CodeChum Admin


I'm bored with just basic counting. How about we do some complex things this time? But I don't want to be associated with any number that's not divisible by 3.




Think you can handle this?






Instructions:


Print out all numbers from 1 to 100 that is divisible by 3, each in separate lines, using a for loop.

Output


Multiple lines containing an integer that is divisible by 3.


3

6

9

12

15

18

21

24

27

30

33

36

39

42

45

48

51

54

57

60

63

66

69

72

75

78

81

84

87

90

93

96

99


2. Factorials

by CodeChum Admin

For those of you who may not now, a factorial is a product of multiplying from 1 until the number. Now, you must make a program that will accept an integer and then print out its factorial using loops.


Are you up for this task?



Instructions:

  1. Input a random positive integer.
  2. Using a for() loop, generate the factorial value of the integer and print out the result.Tip: Factorials work like this: Factorial of 5 = 1*2*3*4*5
  3. Note that there is a special case and that is the factorial of 0 which is 1.

Input

A line containing an integer.

5

Output

A line containing an integer.

120

1. FizzBuzz

by CodeChum Admin


Let’s play a game of FizzBuzz! It’s quite the same with your childhood “PopCorn” game, but with a little bit of twist to align it with programming.




Are you ready?






Instructions:


Input a random positive integer in one line. This will serve as the ending point of your loop.

Using a for() loop, loop from 1 to the ending point (inclusive) and perform the following statements:

If the number is only divisible by 3, print "Fizz"

If the number is only divisible by 5, print "Buzz"

If the number is divisible by both 3 and 5, print "FizzBuzz"

If nothing is true in the previous conditions, skip the number

Input


A line containing an integer.


15

Output


Multiple lines containing a string.


Fizz

Buzz

Fizz

Fizz

Buzz

Fizz

FizzBuzz


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

LATEST TUTORIALS
APPROVED BY CLIENTS