Jump to content

C# Program Help

DarkBlade2117

Alright, right now I am taking a C# class. We are doing what seems to be basic programs though I need a bit of help since it will be some of my first. I have the basic idea of how to work my way around Visual Studio ( We are using Visual Studio 2012 Express ) and I created a program that displayed a message.

 

I am going to type out what he wants though I just need some starting points. Not specifically asking for someone to write out the code needed for my H.W.

> Within any program file where you write source code, include comments throughout your code describing in your own words, what the various sections of your code are doing; single line comments can be preceded by two foward slashes //COMMENT...

 

>for each program create a text file in the folder where your project files are located and call it TestPlan.txt -edit that file for each program below to include a description of the different Tests that you performed to give yourself assurance that your program is valid/is working correctly; this can include validating data to be numeric, validating that required data was entered, exception handling, other test to verify specific calculations,  funtionality, verifying User Interface events etc.

 

( I can send the needed images through imgur at the bottom of this post )

1. A Latin Translator- ( If you want the example programs I can send them through skype or something ). Choose your own sets of words to translate. Name your Project LatinTranslator- Your Name (Michael Justice)

He only had 3 words in his so I can assume he wants at least 3 words to be translated, I was thinking of just going simple and doing Spanish

 

2. A Card Identifier - ( Once again, can send images needed which will be at the bottom of the post, and can send example program if wanted ) CardIdentifier - Michael Justice

 

3. A random Coin Flipper - (Can send example program, + pictures ) FlipACoin - Michael Justice

 

Take all of your completed project folders above and copy them into a folder named IntroGUIProblems - Michael Justice

Zip up this folder and submit the zip file

 

http://imgur.com/a/TPm1B

 

Any help is appreciated and like I stated, I am not specfically asking for someone to go through the trouble of writing this for me, I want some starting points since our book does not directly show us how to do all this. Thanks

 

 

i7-6700k  Cooling: Deepcool Captain 240EX White GPU: GTX 1080Ti EVGA FTW3 Mobo: AsRock Z170 Extreme4 Case: Phanteks P400s TG Special Black/White PSU: EVGA 850w GQ Ram: 64GB (3200Mhz 16x4 Corsair Vengeance RGB) Storage 1x 1TB Seagate Barracuda 240GBSandisk SSDPlus, 480GB OCZ Trion 150, 1TB Crucial NVMe
(Rest of Specs on Profile)

Link to comment
Share on other sites

Link to post
Share on other sites

Alright I got the Coin toss one to work though mainly I need help with identifying the card and the language one. The card one I figured something along the lines of it can just detect which picture/card I am clicking and then displays the Text name.

The language one, I figured have 3 buttons with some spanish words such as Ci, when I click Ci it will display the message Yes. I think I can do this one though the card one is still confusing.

 

 

i7-6700k  Cooling: Deepcool Captain 240EX White GPU: GTX 1080Ti EVGA FTW3 Mobo: AsRock Z170 Extreme4 Case: Phanteks P400s TG Special Black/White PSU: EVGA 850w GQ Ram: 64GB (3200Mhz 16x4 Corsair Vengeance RGB) Storage 1x 1TB Seagate Barracuda 240GBSandisk SSDPlus, 480GB OCZ Trion 150, 1TB Crucial NVMe
(Rest of Specs on Profile)

Link to comment
Share on other sites

Link to post
Share on other sites

What do you mean by card identifier?

And the translator is easy. Just use a dictionary/hash map , don't know exactly how it's called in C#.

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Nineshadow said:

What do you mean by card identifier?

And the translator is easy. Just use a dictionary/hash map , don't know exactly how it's called in C#.

Basically, I think he wants us to pick out some cards ( such as I did in the imgur link ) and when we click it, it will display the name of the card in either a text box or in the same Form in like a text area or something.

 

 

i7-6700k  Cooling: Deepcool Captain 240EX White GPU: GTX 1080Ti EVGA FTW3 Mobo: AsRock Z170 Extreme4 Case: Phanteks P400s TG Special Black/White PSU: EVGA 850w GQ Ram: 64GB (3200Mhz 16x4 Corsair Vengeance RGB) Storage 1x 1TB Seagate Barracuda 240GBSandisk SSDPlus, 480GB OCZ Trion 150, 1TB Crucial NVMe
(Rest of Specs on Profile)

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, DarkBlade2117 said:

I want some starting points since our book does not directly show us how to do all this

You need to learn to give yourself starting points. It's very unlikely you'll ever find a book/tutorial that shows you how to make the specific piece of software you're working on. First you need to think about the problem and its requirements, then break it down into smaller pieces. Once you've done that you can then decide on how you tackle those smaller pieces. You can write the program in many different ways depending on how you choose to implement those smaller pieces. 

 

That way, if you are stuck on a smaller piece, it's much easier to find/ask for information. No longer are you asking general questions like "How do I start making program X", you're asking more specific questions like "One thing that program X needs to do is to store information. I chose to use a plain text file for this but I don't know how to read text files yet. How do I read a text file in C#?". Now that's a simple thing to Google for if you don't know it. Then you move onto the next small piece. Eventually you'll build up a full program that fills all the assignments requirements.

 

So lets take the Latin translator. Here are some steps that you can break it down to. You can get even more specific if you wish.

  1. Need a place to enter/store a list of Latin words and their translations.
  2. Need a place to store, or a way to retrieve, the mappings between the Latin words and their translations.
  3. Need a way to retrieve the translation from a given Latin word.
    • Depends on step 1 and 2
  4. Need a way for the user to select a Latin word to retrieve and display the resulting translation.
    • Depends on application type chosen (Console, WPF, Web, etc), the interface you'll build, and the above steps.
  5. etc

An example implementation of the above may look like

  1. Two text files, one for the latin words and one for the translations
  2. Load the text files into two arrays so that index 0 of the Latin array maps to index 0 of the translations array. Index 1 maps to index 1, etc.
  3. Loop through the Latin array until the word is found. Use the index of that location to retrieve the translation from the translation array.
  4. etc

This is just one example, and there are other ways to do it. Steps 2 and 3 could be improved by using a Dictionary. Steps 1, 2 and 3 could be changed to use a database and SQL. Everything could be hard coded into the program so nothing interesting is actually happening. etc

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×