學習目標:
1. 複習所有曾學習的C++指令,包括cin, cout, if..else, for loop及變量的設定
2. 應用以上的指令。
Assignment 4-1
Calculate the area of a square
- Let the user enter the length and then output the area of the square.
The output is as follow:
Assignment 4-2
Calculate the area of a circle
- Let the user enter the radius and then output the area of the circle
Assignment 4-3
To judge whether a mark means passed or failed.
- Let the user enter a mark. If the mark is larger than 60, output “passed. If not, output “failed”.
Assignment 4-4
To judge whether a number can be divided by 3.
- Let the user enter a number, if the number can be divided by 3, output “ this number can be divided by 3. If not, output “this number cannot be divided by 3”.
Assignment 4-5
Enter a number and then output the same number of “*” in one line.
Calculate the sum of all the numbers between two numbers.
- Enter two number, output the sum of the all the numbers between these two numbers.
Assignment 4-7
Output a square made of “*”
- Enter a number, and output a square with the same number of “* at each side.
Assignment 4-8
Output a right-angled triangle
- Enter the base length of a right-angled triangle and then output the right-angled triangle
Assignment 4-9
Use loop function to output a 9x9 Table
Assignment 4-10
To judge a number whether it is a prime number
- Enter a number and then judge whether it is a prime number.
Assignment 4-11
Output all the prime numbers between 1 to 100
























