Description
Objective :
Learn to use if/else statements to do decision making.
3.1
The zodiac table:
Aquarius (January 20 – February 18)
Pisces (February 19 – March 20)
Aries (March 21 – April 19)
Taurus (April 20 – May 20)
Gemini (May 21 – June 20)
Cancer (June 21 – July 22)
Leo (July 23 – August 22)
Virgo (August 23 – September 22)
Libra (September 23 – October 22)
Scorpio (October 23 – November 21)
Sagittarius (November 22 – December 21)
Capricorn (December 22 – January 19)
Input: 6, 13
Output :
Error Handling:
3.2
Write a program to calculate how much fine David haves to pay after checking his violation.
The violation table: running a red light: $3600 speeding: $1200 riding without a license: $24000 riding without a helmet: $500 using the cell phone while riding: $3000
riding in opposite direction: $1800
Hint:
The ASCII codes of character Y and y are 89 and 121.
The ASCII codes of character N and n are 78 and 110.
Input:
y, y, n, n, y, y
Output :
Please note:: users of visual studio add the following code to your program’s beginning
繳交格式及規定 : 程式重點地方請加註解,給分也會酌量參考註解。
請繳交 .c 檔即可。
c 檔的檔名一律統一,以學號為檔名壓縮成一個以學號為名的壓縮檔
上傳,
上傳請一律繳交壓縮檔。
Example: 若學號為 B123456789, 則.c/.cpp 檔名為 B123456789.c , 而壓縮檔名為 B123456789.rar。
繳交期限 2023.10.12 (四) 09:00 分之前,逾期一律不收,
無輸入輸出及逾期者一律以 0 分計算。
作業請上傳中山網路大學 網大上傳方式:
1. 點選要繳交的作業,選擇「進行作業」。
2. 依照流程上傳檔案。
Reviews
There are no reviews yet.