Download presentation
Presentation is loading. Please wait.
Published byAhmed Lučić Modified over 5 years ago
1
The Problems in Using Visual C and Homework #2 Assignment
Speaker: Yao-Ting Huang Advisor: Kun-Mao Chao National Taiwan University Department of Computer Science & Information Engineering Algorithms and Computational Biology Lab. 2019/2/21
2
Why Your Programs Closed Immediately after Execution
scanf(“%lf”, &miles); When you enter a number and press return, the program receives a number and a carriage return character. e.g., printf(“Additional char is: %d”, getchar()); If you enter “100” and then press enter, you will see Additional char is 10. (Note that the ASCII code for a carriage return character is 10.) Solution: use getch() (need to include conio.h).
3
Be Careful of This Kind of Bugs
The carriage return character can not be seen from the screen. When your program needs to read characters for multiple times, you may encounter bugs. There are many other existed function calls for reading input from the user. e.g., gets. Other problems when using Visual C: Close the execution window when compiling your program. Clear the old workspace and create a new one.
4
Remind of Your Homepages
Please use the web service provided by the computer center. For the details, please refer to Your URL will be like You have to use a FTP client to upload your web pages to the web server. Use the suggested FTP clients: SmartFTP or CuteFTP Pro. The TAs will check the URL by the deadline 10/20. The should contain subject formatted as CME_HOMWORK_1007_StudentID Please to TA 莊竣捷
5
Homework #2 Write a program to take a depth as input data.
Compute and display the temperature in both degree Celsius and degree Fahrenheit at this depth inside the earth. Two useful formulas: Celsius = 10*(depth)+20; Fahrenheit = 1.8*(Celsius)+32; You are required to create two subfunctions to compute the above two formulas respectively. Due date: 10/28 (demo in the lab. lecture).
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.