# Thread: I am using visual basic 2010 and require help to proceed

1. ## 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

Sub Main()

3. ## 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.

4. ## 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

5. ## 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

6. ## 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.

7. ## 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)

9. ## 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)

10. ## Re: I am using visual basic 2010 and require help to proceed

Thank you so much for that. My calculation is working now.

11. ## 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.

12. ## 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!

13. ## 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.

sub main

15. ## 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.

16. ## 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

17. ## 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.

18. ## 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.

19. ## 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

20. ## 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).

21. ## Re: I am using visual basic 2010 and require help to proceed

//Post edited.

22. ## Re: I am using visual basic 2010 and require help to proceed

how do i give users the option to select a paint type

23. ## 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.

24. ## 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

25. ## Re: I am using visual basic 2010 and require help to proceed

Use a ListBox.

26. ## 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

27. ## 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")
then do the calculations based on the paint type.

28. ## Re: I am using visual basic 2010 and require help to proceed

but they have to know the options they have to choose from

29. ## 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.")

30. ## Re: I am using visual basic 2010 and require help to proceed

And after that

31. ## 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```

32. ## 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

33. ## 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.

34. ## Re: I am using visual basic 2010 and require help to proceed

I am trying trial and error

35. ## 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.

36. ## 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

37. ## 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

38. ## 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.

39. ## 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.

40. ## 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
•

Featured