Previous lesson displays static information. In this lesson we are going to use the dynamic display of information. #include <iostream> using namespace std; int main(){ //we declare data types here. string name; //fist we need to display the Instruction for the user."Enter your name: cout<<"Enter your name: //we call the "name" variable to get the user input. we use "cin" to get the user input cin>>name; //we call again our variable name to display what the user input. cout<<"Your name is: "<<name; //try it and try to complete the personal information. add the following variables //age, gender, address, email, mobile }
Using a for loop create a program that will prompts the user for two numbers and then print out a list of even number in between the two given numbers(inclusive), starting from the small number to the big number
Sample Run1
Enter two numbers: 1 10
Output1: 2 4 6 8 10
Sample Run2
Enter two numbers: 9 5
Output2: 6 8
Hello!
I am trying to find how many jelly beans can fit in a jar. so I made some variables.
double height, diameter, beanLength, beanDiameter, glassThickness, radius, newRadius;
double volumeOfJar, airCubicInches, trueVolume, jellyBeanVolume;
as show here. But I need to initialize them. so I tried this
int height;
int diameter;
int beanLength; beanLength = 0.625;
int beanDiameter; beanDiameter = 0.25;
int glassThickness;
int radius;
int newRadius;
int volumeOfJar;
int airCubicInches;
int trueVolume;
int jellyBeanVolume;
But my program does not like that. How do I fix the varibles to be initialized?
diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,
find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole
number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.
The diameter of a cycle wheel is D. Given that, the cycle travels at an average speed of X km/h,
find the number of revolutions made by the wheel per minute, giving your answer to the nearest whole
number (assume PI = 3.142). Write a C++ function to calculate revolutions per minute.