Quiz time, not really bad.

quiz
TC1017 Class

Hello people! I made my first quiz of the class and it was not difficult. It was about the topics that we saw before so I did it so fast.

I felt nervous when Ken gave us the quiz, but after read it I made it without problem. It consists in three programs:

  1. Make a program that calculates the volume of a cylinder.
  2. Make a program that does basic arithmetic operations.
  3. The same as the second but using float (Float uses the numbers with decimals)

Here we used a new command (FLOAT) that is necessary when you want to use decimals numbers on your operations. You have to declare your variables with Float at the begin.

Also I learnt a new command that helps you to separate the message you’re printing to the user. It was (n) and you have to put in the begin of the line that you’re going to print on the board.

For example:

cout<<“Hi my name’s Eduardo.”;

cout<<“nI’m happy with my Flipped Learning.”;

And that runs like that:

Hi, my name’s Eduardo.

I’m happy with My Flipped Learning.

 

And here the screenshot of my programs.

  1. Here we ask to the user for the radius and the height of the cylinder, and then, the program do the operation. Remember that we have to declare the variable PI(3.1416) using the command FLOAT to use decimals numbers.

The screenshots:

prog1

Running:

prog1cpp

2)On this program (It’s the same that the WSQ03 Fun with numbers) we make basic arithmetic operations asking to the user for 2 differents numbers and then make the product, the division and the remainder of the last. Remember that we are using integers numbers so we have to use the command INT.

The screenshots:

prog2

Running:

PROG2g

3) On the last program, we

prog3
prog3c

to use the same as the second one, but using the command FLOAT to use decimal numbers.

So here we have:

prog3

Running:

prog3c

And that was the quiz, as you see, it was not difficult. Hope you can find answers to your questions on this post.

I’ll be back.

Eduardo

Check the codes on GitHub!! The link: https://github.com/eduardomrlsg/TC101/tree/master      and go to program1, 2 and 3 files.

CC BY-SA 4.0 Quiz time, not really bad. by eduardomoralesg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.