O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming Exercises

1:Create a text file with Notepad called C:\MyTestFiles\ShortStory.txt with the contents:
This text
Only contains
Three lines

Write a program that tells the user the full name of the file and when it was created.

Please keep this program handy for exercise 2.

2:Extend the program in exercise 1 so that the program also counts the number of lines in C:\MyTestFiles\ShortStory.txt and shows this number on the console.
3:Write a program that contains an array called rainfall, containing twelve elements of type byte. Each element represents a monthly rainfall reading and can have a value between 0 and 200. Include a simple user interface so that the user can view the element values of rainfall and assign values to any one of its ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required