The Problems in Using Visual C and Homework - PowerPoint PPT Presentation

About This Presentation
Title:

The Problems in Using Visual C and Homework

Description:

... char is 10. (Note that the ASCII code for a carriage return character is 10. ... The carriage return character can not be seen from the screen. ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 6
Provided by: chi115
Category:

less

Transcript and Presenter's Notes

Title: The Problems in Using Visual C and Homework


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.
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.,
  • scanf(lf, miles)
  • 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
  • http//ccms.ntu.edu.tw/jsc/ntucc/homepage/student
    -homepage.html
  • Your URL will be like http//homepage.ntu.edu.tw/
    b90123456
  • 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 email should contain subject formatted as
    CME_HOMWORK_1007_StudentID
  • Please email to TA ??? chemeng_at_ntu.edu.tw

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).
Write a Comment
User Comments (0)
About PowerShow.com