Write a program in C++ to display the cube of the lowest integer up to the number the user will enter. You may use any type of loop that suits to solve the problem.
Create a C++ program that allows user to enter a maximum number from 20-40. From the number entered by the user, print the even numbers using for loop, and do while loop for the odd numbers.
Display the cube of the numbers up to a given intiger using any types of loop the suits to solve problem.
Enter the maximum number: 21
Even numbers are :2 4 6 8 10 12 14 16 18 20
Odd numbers are :1 3 5 7 9 11 13 15 17 19 21
Display the cube of the numbers up to a given intiger:
Input the number of the term:
Number is : 1 and the cube of 1 is : 1
Number is : 2 and the cube of 2 is : 8
Number is : 3 and the cube of 3 is : 27
Process returned 0 (0x0) execution time : 5.878 s
Press any key to continue.
Create a project to model students with firstname, lastname, age, gender and student number. Create two constructors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute. Now given a list of student information create the respective objects and print out their details see samples below, make sure the student class has a toString method.
This is a straightforward program that will "draw" a rectangle using any character selected by the user. The user will also provide the width and height of the final rectangle. Use a nested for loop structure to create the output.
Input:
This program will draw a rectangle using your character of choice.
Enter any character: [user types: *]
Enter the width of your rectangle: [user types: 20]
Enter the height of your rectangle: [user types: 5]
Output:
********************
********************
********************
****************************************
Write a program in C++ to input your name, city and age during program execution and then
print it on the screen. Your output should look like as given below: (where John Doe is name,
city= London and age=40)
Write an application for a furniture company; the program determines the price of a table. Ask
the user to choose one for pine, 2 for oak, or three for mahogany. The output is the name of the
wood chosen as well as the price of the table. Pine tables cost $100, oak tables cost $225, and
mahogany tables cost $310. If the user enters an invalid wood code, set the price to zero
Write an application for a lawn-mowing service. The lawn-mowing season lasts 20 weeks. The weekly fee for mowing a lot under 4,000 square feet is R25. The fee for a lot that is 4,000 square feet or more, but under 6,000 square feet, is R35 per week. The fee for a lot that is 6,000 square feet or over is R50 per week. Prompt the user for the length and width of a lawn USING JOPTIONPANE, and then display the weekly mowing fee USING JOPTIONPANE , as well as the 20-week seasonal fee. Save the file as Lawn.java.
Marks allocation
1. The use of class and object - 10
2. The use of JOption for input -10
3. The use of JOption for output-10
4. correct out -10