- My Forums
- Tiger Rant
- LSU Recruiting
- SEC Rant
- Saints Talk
- Pelicans Talk
- More Sports Board
- Fantasy Sports
- Golf Board
- Soccer Board
- O-T Lounge
- Tech Board
- Home/Garden Board
- Outdoor Board
- Health/Fitness Board
- Movie/TV Board
- Book Board
- Music Board
- Political Talk
- Money Talk
- Fark Board
- Gaming Board
- Travel Board
- Food/Drink Board
- Ticket Exchange
- TD Help Board
Customize My Forums- View All Forums
- Show Left Links
- Topic Sort Options
- Trending Topics
- Recent Topics
- Active Topics
Started By
Message
Need help on C# problem
Posted on 3/2/15 at 2:45 pm
Posted on 3/2/15 at 2:45 pm
Having some mental brick walls on this one for some reason.
Write a console application that will be used in a factories train loading facility to track the number of train cars filled, the total tonnage filled, and the average tons per train car. The program should repeatedly prompt the user for the following until they enter 0 for the first question:
Enter train weight in tons before loading (or zero to quit):
Enter train weight in tons after loading:
You should repeatedly ask these questions until the user enters 0 for the first question. When the user enters zero, output to the screen the total tonnage of product loaded unto the trains for the shift, the total number of train cards loaded, and the average weight in tons per train car. Also, check that the weight after loading is more than before (if not, ask the question over again until the user gets it right).
Write a console application that will be used in a factories train loading facility to track the number of train cars filled, the total tonnage filled, and the average tons per train car. The program should repeatedly prompt the user for the following until they enter 0 for the first question:
Enter train weight in tons before loading (or zero to quit):
Enter train weight in tons after loading:
You should repeatedly ask these questions until the user enters 0 for the first question. When the user enters zero, output to the screen the total tonnage of product loaded unto the trains for the shift, the total number of train cards loaded, and the average weight in tons per train car. Also, check that the weight after loading is more than before (if not, ask the question over again until the user gets it right).
Posted on 3/2/15 at 3:01 pm to Hu_Flung_Pu
quote:
Having some mental brick walls on this one for some reason.
what THEEE frick? google "sample console c# script for simple math operations and output"
Posted on 3/2/15 at 3:10 pm to mikelbr
did you just add "google + subject + content" on me? shameful
Posted on 3/2/15 at 3:12 pm to Hu_Flung_Pu
quote:
Having some mental brick walls on this one for some reason.
What exactly are you asking?
What do you know how to do...and what do you not know how to do?
Posted on 3/2/15 at 3:16 pm to moneyg
-I want to prompt for the 2 questions
-add variables to lists (while != 0)
-when first questions == 0, print out # of entries, after - before + number of entries, average of all
I'm not really good at loops
eta for code coming
for some reason it won't let me post the code on here.
-add variables to lists (while != 0)
-when first questions == 0, print out # of entries, after - before + number of entries, average of all
I'm not really good at loops
eta for code coming
for some reason it won't let me post the code on here.
This post was edited on 3/2/15 at 3:21 pm
Posted on 3/2/15 at 3:24 pm to Hu_Flung_Pu
The menu is a do-while loop.
The list of variables will either be an array or a linked list, whatever they are teaching you in the class.
Code is probably being blocked to prevent someone from injecting a script or sql. You can take a pic of your code and post that.
The list of variables will either be an array or a linked list, whatever they are teaching you in the class.
Code is probably being blocked to prevent someone from injecting a script or sql. You can take a pic of your code and post that.
Posted on 3/2/15 at 3:30 pm to MamouTiger65
It's not very good but that is all I got right now
There are some //Comments to try out different parts and some variables that aren't used up at the top
This post was edited on 3/2/15 at 3:31 pm
Posted on 3/2/15 at 3:40 pm to Hu_Flung_Pu
All of your code to prompt the user, store the values and check that the weights are valid should be inside of your loop.
do
{
Prompt user
If( value <> 0)
{
store value
prompt for after weight
while(weight is invalid)
{
Prompt user for valid weight
}
}
else
{
Print out summary
}
}
while(value <> 0)
do
{
Prompt user
If( value <> 0)
{
store value
prompt for after weight
while(weight is invalid)
{
Prompt user for valid weight
}
}
else
{
Print out summary
}
}
while(value <> 0)
Posted on 3/2/15 at 3:44 pm to MamouTiger65
here is attempt 2 without finish
Posted on 3/2/15 at 3:56 pm to Hu_Flung_Pu
Review the logic in my post above. Just covert that into syntax and you have your app.
Posted on 3/2/15 at 4:10 pm to MamouTiger65
Thank you for your help. If it's not too much to ask, do you mind if I get your email address if I ever have questions about C#? I try to get them myself but sometimes I need help.
Posted on 3/2/15 at 4:43 pm to Hu_Flung_Pu
Just post on here. I probably check this site more than my email.
Posted on 3/2/15 at 7:23 pm to Hu_Flung_Pu
Posted on 3/2/15 at 7:32 pm to OldManRiver
quote:
I think one of your classmates already posted this
Nice find.
I knew this was far too simple for a real train facility. No consideration at all for persistent storage, for example. Plus in the real world I'd imagine a scanner would scan each car's id.
Posted on 3/2/15 at 8:44 pm to OldManRiver
hahahaha at least I got the first one without help
Popular
Back to top
Follow TigerDroppings for LSU Football News