15,910,981 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 12312671 (Top 44 by date)
Member 12312671
9-Mar-16 16:55pm
View
That's the exact opposite, I wont learn anything unless I ask questions; that's how I learn best. The problem is I don't get detailed explanations, I usually just get a pseudo code which I could have written myself. Believe it or not my teacher said, despite all the disagreements I've had with him, that he likes and respects that I put effort into my assignments instead of turning in a half ass'd pseudo code like the rest of our class does. I can only work with what I know and we barely touched files last week. Our final is this Friday, I wanted to make sure I understand everything the course was suppose to cover before I'm no longer in that class.
Member 12312671
8-Mar-16 17:09pm
View
OK, I know the syntax to make an array. By add the next value I think you mean to add each read from fileName1 to array as a value, if I understand correctly. Now the only thing I'm unsure of is the "sort" what would the syntax for that look like, I've never made anything out of order sort (This is my first time working with arrays).
Member 12312671
8-Mar-16 16:55pm
View
what I've learned from my class this past quarter is VB, so at the moment I'm trying to expand off of what I've learned about VB while I finish my degree. I may go back to ITT for programming after I complete my NSA degree. I really had fun in the programming class; it was something new and fun to learn.
Member 12312671
8-Mar-16 16:49pm
View
I figured as much, it honestly makes the most sense. thank you for the response! :)
Member 12312671
4-Mar-16 15:54pm
View
I know its still a mess right now I haven't had time to go through it and sort it out (I usually throw the concept together and then clean it up after), the problem I'm having isn't with the average its with score itself; that's what I've narrowed it down to. As of right now I'm just trying to get letter grade to change it always sees if as an F. If I move score it to other places it wont see it at all. Once I get past the issue with score I think I can figure it out from there.
Member 12312671
4-Mar-16 13:41pm
View
Thanks griff i notice you answer my questions a lot :)
Member 12312671
2-Mar-16 15:20pm
View
Thanks guys :)
Member 12312671
29-Feb-16 19:33pm
View
sorry I've been busy with assignments all day I've been playing with it for a couple hours I'll try out all these methods tonight but right now I have meet a friend (paying me back)
Member 12312671
23-Feb-16 22:19pm
View
Well I got it working thanks to several different worded google searches on accumulators. Google is love Google is life.
Member 12312671
23-Feb-16 21:54pm
View
Not that it pertains to programming but I personally can learn a lot from QA. Not everyone learns the same way, I actually have a high comprehension level. I understand your trying to help me to improve by trying to make me learn the debugger, and believe me I will when I have the time. My degree may be NSA but I do enjoy learning, and I'm having fun with programming regardless of the teacher.
Member 12312671
23-Feb-16 17:20pm
View
Unfortunately my teacher isn't that reliable I've been playing with it with no success
Member 12312671
23-Feb-16 16:17pm
View
I'm not asking you to do my homework as you can see I did most of it, there were also other problems that I did. I just want to know how to make an accumulator. Obviously I have to make a variable for it but I don't know where to go from there.
Member 12312671
23-Feb-16 15:28pm
View
Or rather on each line
Member 12312671
23-Feb-16 15:27pm
View
I forgot one more thing how can I get it to total all amounts at the end?
Member 12312671
23-Feb-16 15:21pm
View
That did it TYVM man :) I appreciate it!
Member 12312671
23-Feb-16 14:59pm
View
see when I multiply it by two, day one is still 2. it needs to start at one and double from there as you can see I multiplied pennies by two in this line with the same result in the code I posted.
Console.WriteLine("Day " & Counter & " you earned: $" & Pennies * 2)
Member 12312671
22-Feb-16 9:45am
View
Hello again I'm working on anther homework program I've got it written for the most part but I need to figure out how to get the number of pennies to double after day 1. Here is what I have:
Module Module1
Sub Main()
Dim Pennies As Double = 0.1
Dim NumberOfDays As Integer = 0
Dim InvalidInput As Integer = 0
Dim Counter As Integer
While InvalidInput <= 0
Console.WriteLine("Enter number of days worked")
NumberOfDays = Console.ReadLine
If NumberOfDays >= 1 Then
For Counter = 1 To NumberOfDays
Console.WriteLine("Day " & Counter & " you earned: $" & Pennies)
Next
ElseIf NumberOfDays = InvalidInput Then
Console.WriteLine("Invalid input")
End If
End While
End Sub
End Module
Member 12312671
8-Feb-16 8:20am
View
I fixed the Color mixer assignment to thanks to your suggestion from last night about the order of the colors. you were a big help thank you again! :)
Member 12312671
8-Feb-16 7:59am
View
Actually I found an easier way to do this, I just added the selection announcement to Each case.
Member 12312671
8-Feb-16 7:50am
View
This is what I had tried initially, however I don't get any results from the .WiteLine.
'Sub displays provider chosen
Sub displayProvider(ByVal mobileProvider)
If mobileProvider = 1 Then
Console.WriteLine("You Selected AT&T.")
ElseIf mobileProvider = 2 Then
Console.WriteLine("You Selected Sprint.")
ElseIf mobileProvider = 3 Then
Console.WriteLine("You Selected Verizon.")
End If
Console.WriteLine("Press Enter to quit.")
Console.ReadKey(ConsoleKey.Enter)
End Sub
End Module
Member 12312671
8-Feb-16 6:56am
View
Ok so I did this, and added a .readkey to keep it from closing, it writes a one to the console. so shouldn't it work for 2 and 3? It works for 1 but if I go through a different selection the result is still AT&T.
Member 12312671
8-Feb-16 6:32am
View
Oh if you selected CInt, it displays the corresponding console.writeline
Member 12312671
8-Feb-16 6:21am
View
In other words what it should translate to is the proper case selection.
Member 12312671
8-Feb-16 6:17am
View
it is defined in VB as (Object As Expression) As Integer
Member 12312671
8-Feb-16 5:54am
View
I ended up waking up around 2 so I decided to finish my homework, its the lab going over case selection. I'm running into one minor issue; the If-ElseIf-Then statement in the third sub doesn't see any cases other than case one.
Here is the Lab:
Module Module1
Sub Main()
'Declasre variables.
Dim mobileProvider As Integer = 0
Dim dataOption As Integer = 0
Dim dataPackage As Integer = True
'Sub calls
InputOptions(mobileProvider, dataOption, dataPackage)
displayProvider(mobileProvider)
End Sub
'Case selection sub.
Sub InputOptions(ByVal mobileProvider, ByVal dataOption, ByVal dataPackage)
Console.WriteLine("Enter 1 for AT&T 2 for Sprint and 3 for Verizon.")
mobileProvider = CInt(Console.ReadLine())
Select Case mobileProvider
Case 1
mobileProvider = "AT&T"
Console.WriteLine("Enter 1 if you want a dataPackage or 2 if you do not.")
dataOption = Console.ReadLine()
If dataOption = 1 Then
dataPackage = True
Else
dataPackage = False
End If
Case 2
mobileProvider = "Sprint"
Console.WriteLine("Enter 1 if you want a dataPackage or 2 if you do not.")
dataOption = Console.ReadLine()
If dataOption = 1 Then
dataPackage = True
Else
dataPackage = False
End If
Case 3
mobileProvider = "Verizon"
Console.WriteLine("Enter 1 if you want a dataPackage or 2 if you do not.")
dataOption = Console.ReadLine()
If dataOption = 1 Then
dataPackage = True
Else
dataPackage = False
End If
Case Else
Console.WriteLine("You did not select a valid option.")
End Select
End Sub
'Sub displays provider chosen.
Sub displayProvider(ByVal mobileProvider)
If CInt(1) Then
Console.WriteLine("You Selected AT&T.")
ElseIf CInt(2) Then
Console.WriteLine("You Selected Sprint.")
ElseIf CInt(3) Then
Console.WriteLine("You Selected Verizon.")
End If
Console.WriteLine("Press Enter to quit.")
Console.ReadKey(ConsoleKey.Enter)
End Sub
End Module
Member 12312671
7-Feb-16 22:06pm
View
I don't know if you saw the other post but he barely has time to help us outside of class. The last time I asked for help he didn't get back to me till the night before, luckily I was able to get everything done prior. Any who I'm Burnt out tonight, I think I just want to unwind now, I can finish tomorrow. Just need to write one more program and fix the color mixer. I really appreciate what you did for me, is there some kind of friend list option on this site? If so may I add you?
Member 12312671
7-Feb-16 21:41pm
View
Also the invalid input was a cosmetic I was going to fix later, I assume accepting other inputs like RED or ReD can be done by assigning another variable?
Member 12312671
7-Feb-16 21:33pm
View
I think your right about that the teacher kept insisting it would work with VB.NET but it never did even in his examples, I'm sure you can understand why this has been frustrating for me. If I try to argue about anything hes wrong about with him waves his status as a programmer in my face, I've kind of stopped relying on him.
Member 12312671
7-Feb-16 21:25pm
View
This is what made me hesitant to use programming forums, and honestly turns me off from wanting to learn programming even though it's a subject that interests me. I'm an NSA student, and I will admit network admins can be very arrogant, myself included. I've looked on programming forums before, any one out of a good chunk of programmers on there are ten times worse than five network admins.
I've always had an interest in programming, never took the initiative to learn it. Right now I have the opportunity and I'm putting in effort to learn this. I don't need your criticism, I never asked for it.
Member 12312671
7-Feb-16 20:49pm
View
So we were taught the == operator declares equivalence between two variables, obviously it didn't work so I tried something else. I tried adding more Else-Ifs for if a variable was entered twice, but for some reason the original lines still take priority so blue blue still makes purple.
Here's what i have:
Module Module1
Sub Main()
'Declare variables
Dim Red As String = "Red"
Dim Blue As String = "Blue"
Dim Yellow As String = "Yellow"
Dim Color1 As String
Dim Color2 As String
'User input
Console.WriteLine("Input 2 colors Choices one at a time from Red, Blue, or Yellow.")
Color1 = Console.ReadLine
Color2 = Console.ReadLine
If (Color1 = Red Or Color1 = Blue) And (Color2 = Blue Or Color2 = Red) Then
Console.WriteLine("Purple")
ElseIf (Color1 = Red Or Color1 = Yellow) And (Color2 = Yellow Or Color2 = Red) Then
Console.WriteLine("Orange")
ElseIf (Color1 = Yellow Or Color1 = Blue) And (Color2 = Blue Or Color2 = Yellow) Then
Console.WriteLine("Green")
ElseIf Color1 = Blue And Color2 = Blue Then
Console.WriteLine("Error: Invalid input")
ElseIf Color1 = Red And Color2 = Red Then
Console.WriteLine("Error: Invalid input")
ElseIf Color1 = Yellow And Color2 = Yellow Then
Console.WriteLine("Error: Invalid input")
Else
Console.WriteLine("
Error: Invalid input")
End If
Console.WriteLine("Press Enter to quit.")
Console.ReadKey(ConsoleKey.Enter)
End Sub
End Module
Member 12312671
7-Feb-16 20:28pm
View
I'm still trying to figure out how to call my subs properly, and pass variables between the subs. The book School provided Tells us to Pass by ref, however this is bad practice we should be passing by val. He did tell us we're not going over loops till next week, so I don't think he expects it to just keep looping the same If-Else-Then statement.
As for fixing the same type input such as Blue Blue, I added this line at the end:
End If
Color1 == Color2
However the issues I'm running into with this is it sees the second = as a syntax error and I get a warning about blue being converted from string to boolean not valid.
Member 12312671
7-Feb-16 20:03pm
View
At the moment it does what its suppose to. I'm just trying to make sure its passable for a grade or if i should work on it some more.
Member 12312671
7-Feb-16 19:45pm
View
Your right that might be a problem how would i go about fixing that
Also here's the other project:
Module Module1
'This Sub declares variables.
Sub Main()
Dim Sum As Integer
Dim Num1 As Integer
Dim Num2 As Integer
Dim Num3 As Integer
Dim Num4 As Integer
Dim Num5 As Integer
Dim Num6 As Integer
Dim Num7 As Integer
Dim Num8 As Integer
Dim Num9 As Integer
Dim Num10 As Integer
Console.WriteLine("Enter a number between 50 - 150")
Num1 = Console.ReadLine
If Num1 >= 50 And Num1 <= 150 Then
Sum = 0 + Num1
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num2 = Console.ReadLine
If Num2 >= 50 And Num2 <= 150 Then
Sum = Sum + Num2
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num3 = Console.ReadLine
If Num3 >= 50 And Num3 <= 150 Then
Sum = Sum + Num3
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num4 = Console.ReadLine
If Num4 >= 50 And Num4 <= 150 Then
Sum = Sum + Num4
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
Console.ReadKey(ConsoleKey.Enter)
End If
Console.WriteLine("Enter a number between 50 - 150")
Num5 = Console.ReadLine
If Num5 >= 50 And Num5 <= 150 Then
Sum = Sum + Num5
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
Console.ReadKey(ConsoleKey.Enter)
End If
Console.WriteLine("Enter a number between 50 - 150")
Num6 = Console.ReadLine
If Num6 >= 50 And Num6 <= 150 Then
Sum = Sum + Num6
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num7 = Console.ReadLine
If Num7 >= 50 And Num7 <= 150 Then
Sum = Sum + Num7
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num8 = Console.ReadLine
If Num8 >= 50 And Num8 <= 150 Then
Sum = Sum + Num8
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num9 = Console.ReadLine
If Num9 >= 50 And Num9 <= 150 Then
Sum = Sum + Num9
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine("Enter a number between 50 - 150")
Num10 = Console.ReadLine
If Num10 >= 50 And Num10 <= 150 Then
Sum = Sum + Num10
Else
Console.WriteLine("Error Integer Given was not within parameters, number will not be added to sum.")
End If
Console.WriteLine(Num1 & "+" & Num2 & "+" & Num3 & "+" & Num4 & "+" & Num5 & "+" & Num6 & "+" & Num7 & "+" & Num8 & "+" & Num9 & "+" & Num10 & "=" & Sum)
Console.WriteLine("Press Enter to quit.")
Console.Rea
Member 12312671
7-Feb-16 19:00pm
View
TY SOOOOO MUCH!!! the last post was worded in a way I could understand, it finally worked I really appreciate the help. :) I was also able to get my Midterm redemption Project fixed in between, could you take a look? I just want another persons input, I need a good grade on it.
Member 12312671
7-Feb-16 18:55pm
View
OOOOOOOOOOHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!! ok ok ok! I think I get it now! :D I will try it out and post the results.
Member 12312671
7-Feb-16 18:34pm
View
So I was thinking of completely separating the expressions like this:
If (Color1 = Red Or Blue) And (Color2 = Blue Or Red) Then
But I'm still getting the warning.
Member 12312671
7-Feb-16 18:15pm
View
While I was waiting for a response I tried a couple things from the Microsoft guide, this seemed the most usable:
Dim Red As String = "Red"
Dim Blue As String = "Blue"
Dim Yellow As String = "Yellow"
But I'm still getting the conversion warning.
Member 12312671
7-Feb-16 18:04pm
View
So correct me if I'm wrong, but I was going in the wrong direction. I literally want the value of Red to be Red?
Member 12312671
7-Feb-16 17:40pm
View
Ok the only issue left is "Conversion from string "Blue" to type 'Double' is not valid."
This is what my code looks like atm:
Module Module1
Sub Main()
'Declare variables
Dim Red As String = Microsoft.VisualBasic.Str(1)
Dim Blue As String = Microsoft.VisualBasic.Str(2)
Dim Yellow As String = Microsoft.VisualBasic.Str(3)
Dim Color1 As String
Dim Color2 As String
'User input
Console.WriteLine("Input 2 colors Choices one at a time from Red, Blue, or Yellow.")
Color1 = Console.ReadLine
Color2 = Console.ReadLine
If Color1 = (Red Or Blue) And Color2 = (Blue Or Red) Then
Console.WriteLine("Purple")
ElseIf Color1 = (Red Or Yellow) And Color2 = (Yellow Or Red) Then
Console.WriteLine("Orange")
ElseIf Color1 = (Yellow Or Blue) And Color2 = (Blue Or Yellow) Then
Console.WriteLine("Green")
Else
Console.WriteLine("Error: Invalid input")
End If
Console.WriteLine("Press Enter to quit.")
Console.ReadKey(ConsoleKey.Enter)
End Sub
End Module
Member 12312671
7-Feb-16 17:30pm
View
This is what I had done to fix the And/Or issue if that's what you meant just now, although I'm not sure if I used the proper type of bracket or placed them in the right place. I'll show you what I did:
If Color1 = (Red Or Blue) And Color2 = (Blue Or Red) Then
Also just want to point out so you don't think I'm just slacking while I'm waiting, I'm also writing the midterm extra credit assignment program between working on this one. Speaking of which would you mind having a look when its done? I feel its bulky and I could consolidate the code to make it a smaller program over all.
Member 12312671
7-Feb-16 16:42pm
View
According to the VB guide on how to assign a value to string it should look along the lines of this:
Dim Red As String = Microsoft.VisualBasic.Left(Red, 1)
Dim Blue As String = Microsoft.VisualBasic.Left(Blue, 2)
Dim Yellow As String = Microsoft.VisualBasic.Left(Yellow, 3)
I believed This to be correct, and it stops all the variables below those lines from having the "variable "x" is used before it has been assigned a value." warning But the Variable = (here, 1) in my code still has that error.
Another major concern is this warning I keep getting: "Conversion from string "blue to type 'Double' is not valid."
Also thank you very much I really appreciate your help so far
Member 12312671
7-Feb-16 16:04pm
View
If you don't know what VB means then you couldn't help anyways. Our teacher doesn't have much time for us outside of class and his teaching style doesn't fit my learning style. It happens I can't have a teacher I see eye to eye with every quarter, but you know what? I'm an adult I deal with it and find the help I need. That aside if want to troll peoples posts go to 4Chan or something I don't have time to deal with Children.
Member 12312671
7-Feb-16 15:44pm
View
Thank you I will look into this, I don't really like our book. This guide seems more structured to my tastes.
Member 12312671
7-Feb-16 15:41pm
View
Ok just got out of the shower saw your post, so I fixed the conceptual issue and now I've noted that VB wont flip the combinations by itself. Still trying to wrap my head around the first part, can you give me more detail.
here's what i did to fix the other problem:
If Color1 = Red Or Blue And Color2 = Blue Or Red Then
Console.WriteLine("Purple")
ElseIf Color1 = Red Or Yellow And Color2 = Yellow Or Red Then
Console.WriteLine("Orange")
ElseIf Color1 = Yellow Or Blue And Color2 = Blue Or Yellow Then
Console.WriteLine("Green")
Else
Show More