Jump to content

Help with C# program

Clanscorpia

Hi, I'm starting to program and my friend asked me to make an app for iOS that would count down to the next Sobey's toonie Tuesday. Because with Xamarin in VS Community 2015, I can use C# (A language I want to learn) to makes apps that connect to other projects so I thought I'd just make a PC app first then make it work on iOS. Here's what I need the app to do and I'm not sure how to  do it. Help would be very appreciated.

 

-A countdown clock that counts down 6 days from the end of Tuesday to the beginning of the next tuesday

-Every time you open the app the time must not reset.

-Auto-run on boot-up would be very nice.

-It needs to be a normal program that you would open up and use like a browser or a game.

 

Thanks for all the help!

 

He who asks is stupid for 5 minutes. He who does not ask, remains stupid. -Chinese proverb. 

Those who know much are aware that they know little. - Slick roasting me

Spoiler

AXIOM

CPU- Intel i5-6500 GPU- EVGA 1060 6GB Motherboard- Gigabyte GA-H170-D3H RAM- 8GB HyperX DDR4-2133 PSU- EVGA GQ 650w HDD- OEM 750GB Seagate Case- NZXT S340 Mouse- Logitech Gaming g402 Keyboard-  Azio MGK1 Headset- HyperX Cloud Core

Offical first poster LTT V2.0

 

Link to comment
Share on other sites

Link to post
Share on other sites

When the app loads up, calculate the time left until the next Tuesday and set the display. Then, create and start a timer to continually update the display while the app is running.

Link to comment
Share on other sites

Link to post
Share on other sites

The thing I'm asking is how, like what lines of code.

He who asks is stupid for 5 minutes. He who does not ask, remains stupid. -Chinese proverb. 

Those who know much are aware that they know little. - Slick roasting me

Spoiler

AXIOM

CPU- Intel i5-6500 GPU- EVGA 1060 6GB Motherboard- Gigabyte GA-H170-D3H RAM- 8GB HyperX DDR4-2133 PSU- EVGA GQ 650w HDD- OEM 750GB Seagate Case- NZXT S340 Mouse- Logitech Gaming g402 Keyboard-  Azio MGK1 Headset- HyperX Cloud Core

Offical first poster LTT V2.0

 

Link to comment
Share on other sites

Link to post
Share on other sites

Some helpful links:

http://stackoverflow.com/questions/1170257/calculate-days-remaining-to-a-birthday

http://stackoverflow.com/questions/12535722/what-is-the-best-way-to-implement-a-timer

The rest (how to make the app itself) can be found by a simple google or youtube search, but if you need more help, qoute this post.

˙ǝɯᴉʇ ɹnoʎ ƃuᴉʇsɐʍ ǝɹɐ noʎ 'sᴉɥʇ pɐǝɹ oʇ ƃuᴉʎɹʇ ǝɹɐ noʎ ɟI

Link to comment
Share on other sites

Link to post
Share on other sites

The thing I'm asking is how, like what lines of code.

 

Sorry, I'm here to help but I'm not going to write the app for you. dannytech357 posted some links to get you started. Give it a try and if you run into trouble, post your code and I'll be happy to help you work out the issues.

Link to comment
Share on other sites

Link to post
Share on other sites

1) Create Thread

2) Work out time left

3) Display time left

4) Start Thread

EG:

Thread t = new Thread (getTimeLeft);t.Start(); //Place this and the above line on the app start.static void getTimeLeft(){   string timeLeft = "work out time";   Console.WriteLine(timeLeft);   //replace WriteLine with the code to display the text on screen.}

This account is no longer used, Please report this account and have it removed.

Link to comment
Share on other sites

Link to post
Share on other sites

1) Create Thread

2) Work out time left

3) Display time left

4) Start Thread

EG:

Thread t = new Thread (getTimeLeft);t.Start(); //Place this and the above line on the app start.static void getTimeLeft(){   string timeLeft = "work out time";   Console.WriteLine(timeLeft);   //replace WriteLine with the code to display the text on screen.}

 

It should be pointed out that this approach is dated in the context of the current version of .Net. In other words there's a better way to achieve this using a thread. There's also another method for achieving the same thing...

 

Alas I shall not be solving it for you either because a couple of quick Google searches will provide you with everything that you need to do it yourself  :lol:

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

It should be pointed out that this approach is dated in the context of the current version of .Net. In other words there's a better way to achieve this using a thread. There's also another method for achieving the same thing...

 

Alas I shall not be solving it for you either because a couple of quick Google searches will provide you with everything that you need to do it yourself  :lol:

I'm aware its not the best of ways to do this but it was just off the top of my head :D

None the less it should be good enough for what OPs trying to do.

This account is no longer used, Please report this account and have it removed.

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks for the help guys! ^_^ I've been forcing myself to learning C# well to get this and I truly started to code it last night :P. My dad told be to watch and learn something on YouTube so I just started watching C# vids. I think I can figure this out on my own now that I've realized how similar this is to Arduino code. If I need any help I'll ask here. I do need help with another learning project (Calculator) so if you guys wanna help look at my other thread  :D . Thanks guys!

He who asks is stupid for 5 minutes. He who does not ask, remains stupid. -Chinese proverb. 

Those who know much are aware that they know little. - Slick roasting me

Spoiler

AXIOM

CPU- Intel i5-6500 GPU- EVGA 1060 6GB Motherboard- Gigabyte GA-H170-D3H RAM- 8GB HyperX DDR4-2133 PSU- EVGA GQ 650w HDD- OEM 750GB Seagate Case- NZXT S340 Mouse- Logitech Gaming g402 Keyboard-  Azio MGK1 Headset- HyperX Cloud Core

Offical first poster LTT V2.0

 

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

×