Project 1 : A Simple First Project
Summary: lets
practice with files and basic go
Due:
Wednesday Sept 30th at 11:59pm
(I'll give project 2 to the
grad students before this one is due.
Details:
Create a new project. Make
sure it has your name in it somewhere in the project name.
(granted I am pushing the
limits to try and get a simple program which practices lots of what we
learned, some of this may seem forced)
Write go go program that
has functions
The main function will
-
Start a command line shell
like loop - offer the user a menu of choices and read the user's typed
reply
- switch on the reply and choose one of the options. Each one should
invoke a function (those are described below).
- one of the options should be to quit the program - when the user
chooses that one do so
- Keep asking what the user wants to do and then doing it until the
user chooses to end the program.
The one function will
-
Open a file of the
user's choosing and read it in.
- ask the user for a number X, print every Xth line of the file to the
screen
The next function will
- prompt the user to type in a string
- report (in a manner that the user can easily tell which is which) how
many byte and how many characters the users input is
- When I test your program, I will be pasting in some text that is
English, some that contains emojis and some that contains non-English
characters.
The next function will
- create a struct with at least three values of different types as
fields.
- print that struct
- call another function passing the struct as a parameter
- in this new function, make a change to the struct and print it
- return from the new function
- print the struct again in the original function
- make sure that the prints are expressive enough for a user to
understand
The next function will
- create a list of two structs of the sort from the previous function
above
- print that list
- call another function passing the list of structs as a parameter
- in this new function, make a change to the second struct in the list
and print the list
- return from the new function
- print the list again in the original function
- make sure that the prints are expressive enough for a user to
understand (and the user can understand the difference between this and
previous function)
Submitting the project.
submit the project by putting it on github and sending me a collaboration
invite.