Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 17th, 2007, 10:06 PM
outsiders69 outsiders69 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 3 outsiders69 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 38 sec
Reputation Power: 0
Help with Homework

I missed 2 weeks of school due to a family member passing away. I am in computer programing 101. I have completed the first two assignments but desperately need help on how to make this simple program.I would be gratefull if someone can help me please.

Congratulations, you?re going to the moon. Really. In fact, you?ve been appointed Flight Commander.

As you might guess, weight is a critical factor in the overall success of your mission. As Commander, you need to carefully screen your crew for weight minimums and maximums. An astronaut must weigh at least 75 kgs (kilograms) and no more than 85 kgs. You have just one candidate you must interview. Unfortunately, your potential astronaut doesn't know his or her weight in kgs, only pounds. The program you develop must therefore allow the user to input their name, their weight in pounds, do the conversion to convert pounds to kgs, and then output one of three possible messages:

Sorry, ___ kilograms is too light,
Congratulations, ___ kilograms meets the weight requirement, or
Sorry, ___ kilograms is too heavy.
Note that response 1 is only displayed if the weight is less than 75 kgs, and response 2 is only displayed if the weight is 75-85 kgs. Response 3 display only if the weight is over 85 kgs (fill in the ___ with the actual value for kgs).

Finally, when the input of the potential astronaut's weight is finished, your program should output a summary of the weight of the astronaut in pounds and in kilograms, with an extra message for the candidate if they are too heavy indicating just how much weight in pounds they must loose to be within range; and the same for the potential astronaut who is too light, displaying a message of how many pounds they must gain before they are eligible.

HINT: 1 pound = 0.4535 kilograms

Reply With Quote
  #2  
Old January 17th, 2007, 10:28 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
Usually homework question elicits only humorous replies, if any at all.

Now, if you've started your vb code and have a section that's giving you a problem, and if you ask a clear and lucid question including code snips, error messages, and an explanation of the problem, you'll likely get helpful responses.

If you want someone to do your homework for your, well, we know what that's called in school ...
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old January 17th, 2007, 11:12 PM
outsiders69 outsiders69 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 3 outsiders69 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 38 sec
Reputation Power: 0
Ok

Ok I understand. Can some help me on how to star off a least. I just want to get it started. I will admit that I am confused but for Now I just need someone to get me started.

Reply With Quote
  #4  
Old January 18th, 2007, 12:09 AM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
Quote:
Originally Posted by outsiders69
Ok I understand. Can some help me on how to star off a least. I just want to get it started. I will admit that I am confused but for Now I just need someone to get me started.


Sure, I'll give you a push in the right direction!

If you want, create 2 textboxes for the input (name and weight in pounds).

From the input given in the weight textbox, find out how many kilograms it equates to, you can do this by multiplying the input pounds by 0.4535.

Since you now have the weight in kilograms, you can check if the person is under, over, or meets the weight requirement. You could do this several ways, I would probably use Select Case, it looks clean in my opinion. Now, just based upon the weight (<75, >85, >75 & <85 ) you can use message box to show the result of the person.

Although, the part of the assignment asking for the name input is rather inane, since it doesn't actually use it anywhere.

Hope that helped,
-Alias

Reply With Quote
  #5  
Old January 19th, 2007, 09:17 PM
outsiders69 outsiders69 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 3 outsiders69 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 38 sec
Reputation Power: 0
Need Help Please

This is what I can come up with. Please help me.



Module Module1

Sub Main()
' Nasa pre-filght, version 1.0
Dim Number As Integer
Dim Weight As Integer
Dim ShowMe As String
Number = 75 Or 85
Console.WriteLine("Welcome to the Nasa!")
Console.WriteLine("Enter your weight:")
Weight = Integer.Parse(Console.ReadLine())
If Weight < 75 Or Weight > 85 Then
Console.WriteLine("You weight out of range!")
ElseIf Weight = Number Then
Console.WriteLine("Congratulations! You weight is perfect!")
Else
Console.WriteLine("Too bad. Your weight is off.")
Console.WriteLine("Do you want to know what you need to weigh (Y/N)")
ShowMe = Console.ReadLine()
If ShowMe = "Y" Then Console.WriteLine("You need to weigh 75 to 85" & Number)
End If
End Sub

End Module

Reply With Quote
  #6  
Old January 19th, 2007, 09:59 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 57 m 26 sec
Reputation Power: 181
What happens when you try your code? Do you get errors?

Reply With Quote
  #7  
Old January 20th, 2007, 03:56 AM
Alias-Zero Alias-Zero is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Location: localhost
Posts: 40 Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level)Alias-Zero User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 14 h 44 m 12 sec
Reputation Power: 4
Send a message via ICQ to Alias-Zero Send a message via AIM to Alias-Zero Send a message via MSN to Alias-Zero Send a message via Yahoo to Alias-Zero
I'll give you your solution, since you've been asking nicely, and had family member pass away.

This is VB6:

>>2 TextBoxes -
1. txtName
2. txtWeight

>>1 Command Button -
1. btnWeightCheck


Code:
VB6

Private Sub btnWeightCheck_Click()
Dim weightKG As Double
weightKG = txtWeight.Text * 0.4535

Select Case weightKG

Case Is < 75
MsgBox "Sorry " & txtName.Text & ", but you're below the weight requirements.", vbOKOnly, "Underweight"

Case Is > 85
MsgBox "Sorry " & txtName.Text & ", but you're above the weight requirements.", vbOKOnly, "Overweight"

Case Is > 75 < 85
MsgBox "Congratulations " & txtName.Text & ", you meet the weight requirement!", vbOKOnly, "Perfect!"

End Select

End Sub

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Help with Homework


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT