write C++ code
ask user 1 for age
assign age
ask user 2 for age
assign age
Determine who is older
Display who is older
Add pazzaz.
#include <iostream>
using namespace std;
int main()
{
int age1, age2;
cout<<"Enter user1 age: ";
cin>>age1;
cout<<"Enter user2 age: ";
cin>>age2;
if(age1==age2){
cout<<"Both User1 and User2 are of same age"<<endl;
}
else if(age1>age2){
cout<<"User1 is older"<<endl;
}
else{
cout<<"User2 is older"<<endl;
}
return 0;
}

write C++ code ask user 1 for age assign age ask user 2 for age assign...
Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered. To get proper credit, name the variables as listed below and follow the directions carefully. Do not use any break or similar type of statements. To implement the above code, you will need to count the entries - name the counter variable num_count. You will also need to use a variable,...
Python code
Write a program that will ask the user to input two strings, assign the strings to variables m and n If the first or second string is less than 10 characters, the program must output a warning message that the string is too short The program must join the strings m and n with the join function The output must be displayed. Please name the program and provide at least one code comment (10)
Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...
python code? 1. Create a class called Person that has 4 attributes, the name, the age, the weight and the height [5 points] 2. Write 3 methods for this class with the following specifications. a. A constructor for the class which initializes the attributes [2.5 points] b. Displays information about the Person (attributes) [2.5 points] c. Takes a parameter Xage and returns true if the age of the person is older than Xage, false otherwise [5 points] 3. Create another...
write a c++ code be sure the user only enter A or a for packageA, B or b for packageB, C or c for packageC. If the user inputs some other value display an error message saying " invalid out". When you ask the user to input the number of minute and the user enters a negative value you should display the same error message "invalid input" in both cases, after you display the error message the program should stop...
thank
you!!
c++
9. Write the code to prompt the User for website name and a domain name. Display the website name, then add “www.” to the beginning of it and“. <domain name>” to the end of it, where <domain name> is the domain name they entered (e.g. “com”, “edu”, “net”, etc.). If the user included the “.” (dot) in the <domain name>, do not add an additional dot. If they did not include the dot, then add the dot...
Python Please!! Write code to ask the user to provide 2 numbers and to divide the two numbers to find the reminder. Return the reminder. Code must work if the user provides a zero as divisor.
Write an interactive C++ program that asks a user to input the color code of a resistor and determines its value and tolerance Tell the user how to input the color rings “Instructions” Tell the user to input the colors one after the other After the program receives the information it will display the resistance and tolerance Output an error message if the user enters an invalid color code (no garbage values should be displayed), and ask for another input...
This MUST be done in C++ Write a program with a loop to ask the user for an integer greater than or equal to 2 and then pass the integer to a function which will produce and display on the console the ulam sequence1. Do not accept a number less than 2. 1The ulam sequence begins with an integer. If it is even, divide by 2. If it is odd, multiply by 3 and add 1. Then apply the appropriate...
c++ QUESTION 9 Write a code that ask the user for the number n of decimal to average. Then n times the code the user to enter all numbers that you save or accumulate each time. Finaly print to the console the average of the n values the user entered using the format: cout << " The average of the " << n << " number you entered is: " << averagedValue <<endl;