-
Jan 18th, 2014, 10:45 AM
#41
New Member
Re: I am using visual basic 2010 and require help to proceed
It's all pretty good . good luck for your program . It's looks like very use full .
bSBYLZ
-
Jan 18th, 2014, 04:58 PM
#42
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Last edited by junied32167; Jan 23rd, 2014 at 06:51 PM.
-
Jan 18th, 2014, 05:05 PM
#43
New Member
Re: I am using visual basic 2010 and require help to proceed
You have already done the calculations. Area of room is Width x Height. Just remember to put it in meter squared as requested on the assignment.
Last edited by Mohammed Tahmid; Jan 24th, 2014 at 03:11 PM.
-
Jan 18th, 2014, 08:32 PM
#44
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
I belive there is something wrong with my coding as i can not calculate the area of the room when d program is run
-
Jan 18th, 2014, 09:46 PM
#45
Re: I am using visual basic 2010 and require help to proceed
You don't want the area of the room. You want the surface area of the walls... which is completely different. You need to add the lengths of the 4 walls together, then multiply that by the height.
you were close with this:
areaofroom = (wall1 + wall2 + wall3 + wall4 * rHeight)
but what you really need it this:
areaofroom = (wall1 + wall2 + wall3 + wall4) * rHeight
-tg
-
Jan 18th, 2014, 11:17 PM
#46
Re: I am using visual basic 2010 and require help to proceed
Originally Posted by dunfiddlin
Are you trying to get me banned again?
I sincerely hope not since most of your replies in this forum have been very valuable. I banned you because of the few replies you made that simply ****ed people off! Those few posts, which with your post count turned out to be much more than a few, was simply not acceptable. So I truly hope that you, in the future, keep posting those valuable posts, that we all love to see from you, and that you simply refrain from posting *at all* in those threads where you feel that you need to lecture the OP.
I would really hate to ban you for life since you do have the ability to help people around here.
-
Jan 18th, 2014, 11:28 PM
#47
Re: I am using visual basic 2010 and require help to proceed
I would hate for dun to be banned. I always feel more warmed to him and members like Niya who can mix it with the professionals when they dont program for a living. I guess moderators have to separate personal views and take each post on a serious level. (your friends book arrived and i must say kis great even 4 chapters in)
-
Jan 19th, 2014, 09:42 AM
#48
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Last edited by junied32167; Jan 23rd, 2014 at 06:52 PM.
-
Jan 19th, 2014, 10:55 AM
#49
New Member
Re: I am using visual basic 2010 and require help to proceed
lol, Kudos. A few problems. The Console.ReadLine() comes afterwards. Also you didn't output the value onto the screen yet. You can do this by concatenation of strings:
areaofroom = (wall1 + wall2 + wall3 + wall4) * rHeight
Console.WriteLine("Area of room: " & areaofroom)
Console.ReadLine()
Last edited by Mohammed Tahmid; Jan 24th, 2014 at 03:12 PM.
-
Jan 19th, 2014, 01:29 PM
#50
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Thank you so much for that. My calculation is working now.
Last edited by junied32167; Jan 24th, 2014 at 03:32 PM.
-
Jan 19th, 2014, 02:12 PM
#51
Re: I am using visual basic 2010 and require help to proceed
Originally Posted by junied32167
who is kudos. I think you have me confused wiv someone else.
lol
Originally Posted by wikipedia
kudos (from the ancient greek: κῦδος) is acclaim or praise for exceptional achievement.
-
Jan 20th, 2014, 12:54 AM
#52
Re: I am using visual basic 2010 and require help to proceed
kudos as neuter means acclaim,glory,pride etc
However kudos as adjective means insult,taunt,slander. (the beauty of Greek language)
So clearly Mohammed is secretly bashing that poor guy and should be immediately banned!!
Good thing you've got those Greek people here to catch the ancient Greek secret insults
P.S. If you don't get banned once, it does not worth the trip. So thanks for whoever banned me a couple of years ago!
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Jan 20th, 2014, 12:13 PM
#53
Re: I am using visual basic 2010 and require help to proceed
However kudos as adjective means insult,taunt,slander. (the beauty of Greek language)
Um. I'm sure that even in Greek an adjective can't mean a noun! Kudos is in this case a naturalised English word anyway. Any darker associations may be discounted.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jan 20th, 2014, 12:14 PM
#54
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Last edited by junied32167; Jan 23rd, 2014 at 06:53 PM.
-
Jan 20th, 2014, 12:22 PM
#55
Re: I am using visual basic 2010 and require help to proceed
I require help as to how im goona do this.
You really don't. It's essentially exactly the same procedure as what you've done so far. You could snazz it up a bit by having the user type in an option rather than a price but before this turns into War And Peace keep doing what you're doing.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jan 20th, 2014, 12:40 PM
#56
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Its diffrent the prices how should i dim them. Furthermore integer is not the right variable to use here
-
Jan 21st, 2014, 09:01 AM
#57
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Dim luxury, standard, Economy As Integer()
Console.WriteLine(" please choose from the following paints")
luxury = 1.75
standard = £1.00
Economy = 0.45
This is the coding I have used what is wrong with it.
-
Jan 21st, 2014, 10:08 AM
#58
Re: I am using visual basic 2010 and require help to proceed
First of all, you're declaring you variables as integer arrays, removed the parenthesis to make them regular integers... However as you've noticed integer is not the correct type, why? Because an integer can only hold, well you know, integers. That is whole numbers (3, 12, 75, or 8 for example) and not anything with a fraction (such as 3.14 or 5.96). A Single or a Double can hold floating point values. I would go with Double since they have better precision.
-
Jan 21st, 2014, 12:40 PM
#59
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Thanks for that Joacim Andersson. Do you know how to add the £ sign to the prices
Dim luxury, standard, Economy As Double
Console.WriteLine(" please choose from the following paints")
luxury = 1.75
standard = 1.0
Economy = 0.45
-
Jan 21st, 2014, 01:09 PM
#60
Re: I am using visual basic 2010 and require help to proceed
Well, if you want to type it out you could obviously just do this:
Code:
Console.WriteLine("The price for luxury is £" & luxury)
However you can also format the Double into a currency string this way:
Code:
Console.WriteLine("The price for luxury is " & luxury.ToString("C"))
The Double.ToString("C") means that you want to convert the value into a string in currency format. However this is culture aware so the output will depend on your Windows culture settings. In the UK the output will be £1.75, in the US it will be $1.75 and for me, who lives in Sweden, the output will be 1,75 kr (yes, we use comma as the separator in Sweden), in other parts of Europe the output will either be €1.75 or €1,75 depending if the country in question use period or comma as the separator (other separators might also exist when it comes to currency, so perhaps something like €1:75 would be the output).
Last edited by Joacim Andersson; Jan 21st, 2014 at 01:15 PM.
-
Jan 21st, 2014, 02:09 PM
#61
New Member
Re: I am using visual basic 2010 and require help to proceed
Last edited by Mohammed Tahmid; Jan 23rd, 2014 at 07:10 PM.
-
Jan 21st, 2014, 04:22 PM
#62
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
how do i give users the option to select a paint type
-
Jan 22nd, 2014, 05:16 AM
#63
Re: I am using visual basic 2010 and require help to proceed
How did you give them the option to enter the length of a wall? It's exactly the same problem.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Jan 22nd, 2014, 11:58 AM
#64
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Entering the length of the walls is a must whilst a user will have to choose a paint which is why the coding will be diffrent
-
Jan 22nd, 2014, 12:38 PM
#65
Re: I am using visual basic 2010 and require help to proceed
-
Jan 22nd, 2014, 01:19 PM
#66
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
i can only make this program in a console application so i only can use coding
-
Jan 22nd, 2014, 02:09 PM
#67
Frenzied Member
Re: I am using visual basic 2010 and require help to proceed
so then have them type in luxury, standard or economy.
Code:
Console.ForegroundColor = ConsoleColor.Blue
Console.WriteLine("Please enter the type of paint to use")
paintType = Console.ReadLine
then do the calculations based on the paint type.
-
Jan 22nd, 2014, 02:17 PM
#68
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
but they have to know the options they have to choose from
-
Jan 22nd, 2014, 02:25 PM
#69
Frenzied Member
Re: I am using visual basic 2010 and require help to proceed
Console.WriteLine("Please enter the type of paint to use:luxury, standard or economy. Please pick one.")
-
Jan 22nd, 2014, 02:31 PM
#70
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
-
Jan 22nd, 2014, 02:52 PM
#71
Re: I am using visual basic 2010 and require help to proceed
I would type out a menu and let the user just pick 1, 2, or 3.
Code:
Console.WriteLine("Select a type of color.")
Console.WriteLine("1 - Luxery")
Console.WriteLine("2 - Standard")
Console.WriteLine("3 - Economy")
Console.Write("Make a selection (1-3): ")
Dim paintType As String
Dim doItAgain As Boolean = False
Do
Dim paintValue As String = Console.ReadLine()
Select Case paintValue
Case "1"
paintType = "Luxury"
Case "2"
paintType = "Standard"
Case "3"
paintType = "Economy"
Case Else
doItAgain = True
Console.Write("Invalid selection. Try again (1-3): ")
End Select
Loop While doItAgain
-
Jan 22nd, 2014, 03:00 PM
#72
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
If i do that then how would i then calauclate the paint type by the area of the room
-
Jan 22nd, 2014, 03:01 PM
#73
Re: I am using visual basic 2010 and require help to proceed
So at what point are you going to do any of this your self? There is trying but this is home work at the end of the day.
-
Jan 22nd, 2014, 03:04 PM
#74
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
I am trying trial and error
-
Jan 22nd, 2014, 03:08 PM
#75
Re: I am using visual basic 2010 and require help to proceed
No what you is doing is after a new solution is posted asking the next question.
-
Jan 22nd, 2014, 03:19 PM
#76
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
no i do d coding and when i require help i ask you
-
Jan 22nd, 2014, 04:14 PM
#77
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
If i wanted to restrict the user from entering a number higher then 6 how would i do that
-
Jan 22nd, 2014, 04:16 PM
#78
Re: I am using visual basic 2010 and require help to proceed
Originally Posted by junied32167
If i do that then how would i then calauclate the paint type by the area of the room
If you already know the area and you know the paint type then do the calculation. Try to think how you would do this in your own head and then try to transform that into source code. It's not very difficult to do.
-
Jan 22nd, 2014, 04:17 PM
#79
Re: I am using visual basic 2010 and require help to proceed
Originally Posted by junied32167
If i wanted to restrict the user from entering a number higher then 6 how would i do that
I already showed you how to restrict the user from choosing between 1, 2, and 3.
-
Jan 22nd, 2014, 04:39 PM
#80
Thread Starter
Lively Member
Re: I am using visual basic 2010 and require help to proceed
Can there be more then 6 cases
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|