Create A Magic 8 Ball That Would Display Answers Via Array?

Apr 17, 2011

The goal in this assignment was to create a Magic 8 Ball that would display answers via array.Here's what I got down so far, now I apologize once again, I forgot most of the stuff so I don't even know if it is REMOTELY close to what it's suppose to be

Public Class Form1
Dim ArrayRes(7) As String
Private Sub btnASK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnASK.Click

[code]....

View 4 Replies


ADVERTISEMENT

New Years Ball Drop - Timer To Count Down From 30 And Reach 0 When The Ball Is At The End Of The Pole?

Apr 5, 2011

I have a this program I have to write but I have no clue where to even start.New Years Ball Drop?Design a program that replicates the Times Square New Year�s Eve ball drop. You can use a picture from the Internet of the ball you wish to use.Functionality Requirements:

-The ball will take exactly 30 seconds to move down the pole

-Need a timer to count down from 30 and reach 0 when the ball is at the end of the pole

-The timer will randomly change colour every few seconds

- When the ball has finished descending, the text �Happy New Year!� will display on the screen

-Need a button on the form that, when clicked, stops the ball drop and timer (so screenshots can be taken). When the button is clicked again, the timer and ball drop should resume from where it left off.

View 1 Replies

Designing Magic Square - Scanning Array With Function

Mar 18, 2011

I'm designing a 3 x 3 Magic Square, where the 3 x 3 tables are made of up three adjacent list boxes. Upon starting the program, the 3 x 3 square consists only of the character "?" to represent a variable that has yet to be defined. The user will input through text boxes and button presses the characters 1 to 9, replacing the highlighted undefined "?' with the desired number. I'm required to include a Function procedure that can, at any time scan the 3x3 table and return an integer value of -1 if an undefined character "?" is present, a value of 0 if the rows, columns and diagonals do not sum to the same value, or the sum common to all rows columns and diagonals.

To start with I defined a 2D array and undefined.
Dim mSquare(2,2) As String
Dim undefined As String = "?"

Then I used a Sub to set the 3x3 table as undefined which I did not show to save space. Next I used a Sub to update the highlighted characters, allowing only one list box to be selected at a time and which I hope also assigns the the values to the array as they are updated. I removed parts of the code so this post isn't too big.

If lstCol2.SelectedIndex = -1 And lstCol3.SelectedIndex = -1 Then
lstCol1.Items(lstCol1.SelectedIndex) = input
txtInput.Text = ""
End If
For i As Integer = 0 To 2
[Code] .....

What I'm stuck on is the Function design. I'm trying to design something to scan the array, and give back an integer depending on the results, which are to return an integer value of -1 if an undefined character "?" is present, a value of 0 if the rows, columns and diagonals do not sum to the same value, or the sum common to all rows columns and diagonals.

I'm currently trying
Function checkSquare(ByRef mSquare As String) As String
For i As Integer = 0 To 2
[Code] .....

At the moment I keep getting the error "Public Readonly Default Property Chars(index As Integer) As Char". I keep getting an error like this even using a single variable and defining each j individually, and I'm wondering if its possible to pass arrays to functions or do I need to do something else. Is what I'm trying to do even possible? I did a longer method in which I just check all the entries individually but I'm hoping there is a more efficient way. Its my plan B for now.

View 6 Replies

Declare An Array Of 20 Integers To Store The Answers ?

Jan 29, 2009

I am looking to declare an array of 20 integers to store the answers to the questions, and then for the next button i am looking to get the answer and write it to the array. If one radio button is checked then i want it to write 1 to the array. Then finally i want to write the username, the array of answers and score to the txt file. How can I do that?

below is my code i have so far:

Imports System
Imports System.IO
Public Class Question

[Code].....

View 1 Replies

Define The Length Of The Array Ball() In Tinnings Structure To 6?

Feb 12, 2010

Structure Tinnings
Dim bowler As String
Dim ball() As tballs
End Structure

[code].....

how can i now define the length of the array ball() in Tinnings structure to 6, (its a cricket program, with 6 runs in an over).

View 3 Replies

When Build Project To Create Exe / Want To Include 3d Control Magic.exe Into It

Mar 11, 2010

I've used 3d control magic for VB.NET to create shaped forms.When I bulid my project to create an exe, I want to include 3d control magic.exe into it, to be installed automatically in the clients computer.

View 1 Replies

[2008] Express Edition - Create A Variable /add Up The Score Of Correct And Incorrect Answers?

Feb 27, 2009

i am creating a quiz which would be 20 questions for software design students and may use alot of code.my first problem is the score for the test, i know a friend of mine can add up the score but he cant move onto the next thread until you have got the question correct which is sort of cheating, i want to know how you create a variable and make that variable stay in all the forms and add up the score of correct and incorrect answers and come up with a final score for the user in the end.

View 8 Replies

Search Within An Array And Display The Number Of Occurrences That A Value Within The Array Appears?

Nov 13, 2010

I have to search within an array and display the number of occurrences that a value within the array appears. I know that my code is incorrect but this is what I have so far. If anyone can point out what I am doing wrong that would be great.

Private Sub btnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResult.Click
Dim intSearchAmount As Integer
Dim intCounter As Integer
Dim intIndex As Integer

[code].....

View 3 Replies

Magic Number Vs Constant?

May 11, 2012

I save a lot of settings in an INI file as 1 (enabled) and 0 (disabled), all around the project's module i have this check If setting = 1 then ' do somethingEnd If ' OR If setting = 0 then ' do somethingEnd If

My question, is it good for performance to declare public constants to hold 1 & 0 and use them in such above checks instead of using real number?

In general, if i use value like 8, 9, "", "$", etc... in just two different places, should i declare constant for it?

View 16 Replies

Late Binding Magic Under .NET Converted To C#?

Nov 22, 2011

I should convert some code from VB to C#. Given following lines of VB work (I think only because option is not set to strict):

Dim someProp As SomeType
Try
someProp = CType(SomeInstance, Object).SomeProp
' ...

Due to late binding, this code is possible under VB. Of course, following won't work under C#:

SomeType someProp;
try
{
someProp = ((object)SomeInstance).SomeProp;
// ...

How could I formulate something similar under C#?

View 1 Replies

Making A Bouncing Ball?

May 14, 2011

I am trying to make a Bouncing ball, not with an ovalshape but with a graphic. This is the code so far.

Public Class Form1
Private r_index As Integer
Private startx As Integer

[code].....

View 14 Replies

Magic Numbers - File Header And Footer

Feb 12, 2011

For my project, I need to develop an app, which will have MS-SQL db with 4 tables
a>FileHeader
b>FileFooter
c>Extension
d>Detail about the file.
This is all to do with the Magic Numbers, or File header and footer, found in all files. The first 4-byte and last 4-bytes.

Example:
Suppose a word DOC file when read using this app should return and match the values
D0 CF 11 E0
So, how can I read the files using vb.net, fileIO, FileStream/StreamClass/FileReader? I just need to open the file and read the first 4 and last 4 bytes of any given file. And then it should connect back to the SQL database and lookup for the matching values from the tables as I had mentioned. And return a match found or not found.

View 5 Replies

VS 2008 - Writing A Driver For Magic Mouse In VB

Mar 7, 2010

I use the Magic Mouse, it's fantastic in OSX but more so because of MagicPrefs which extends the multi-touch gestures its capable of. I'd like to know if its possible for me to write drivers for the Magic Mouse in VB? to extend it's functionality. Or would this be better suited for C++? I don't even know where to start.

View 4 Replies

VS 2008 UDPclient.send Magic Packet (wol)

Jan 9, 2010

I want to make an application which turns on my computer. A Wake-on-Lan application should do the trick. I allready created something which sends data over UDP, i can see that it sends the data (with wireshark) but it does not send the correct data.

[Code]...

View 2 Replies

Cannot Get The Ball To Return To Its Original Position?

Nov 9, 2009

in school im making a dodge ball game but i cannot get the ball to return to its original position. My code and form are below

[Code]...

View 6 Replies

Game - Bouncing Ball With Paddle

Feb 13, 2010

Write an application that allows the user to play a game, in which the goal is to prevent a bouncing ball from falling off the bottom of the Form. When the user presses the S key, a blue ball bounces off the top, left and right sides (the �walls�) of the Form. A horizontal bar on the bottom of the Form serves as a paddle to prevent the ball from hitting the bottom of the Form. (The ball can bounce off the paddle, but not the bottom of the Form.) The user can move the paddle using the left and right arrow keys. If the ball hits the paddle, it bounces up, and the game continues. If the ball hits the bottom of the Form, the game ends. The paddle�s width decreases every 30 seconds to make the game more challenging.

View 4 Replies

Make The Ball Move Faster?

Apr 26, 2011

how to change the balls speed

View 2 Replies

Picturebox Changing Image Into A Ball

Mar 31, 2012

I am trying to make a 'puppet' change into a ball when I press e.g. the right arrow key. I used getasynckeystate(keys.right) to check for the key in a timer. The moving is working well but I don't have an idea how I can make it change in a picture of the 'puppet' changing which then changes into a ball. Does someone know how to do this?

View 3 Replies

Getting Answers Into Decimal And Calculating

Feb 10, 2009

I'm trying to get the answer "dblcost" to go into 2 decimal spots. Sometimes it does, sometimes it doesn't.Also, I have to create something that continually adds each transaction to lblfinalcost. Mine seems to be a little buggy.Right not I have strfinalcost = strginalcost + dblcost. Another question i have is how do I make a number default into the textbox? I want it to say 1, but be able for the user to delete it and then replace it with their own number.[code]

View 14 Replies

Signature For Msdn Answers?

Dec 12, 2009

if you are a constant answerer here on msdn, and do not have a unique signature, or no signature at all, please take a little time to create one... eason ..when quoting a post of a member, if no signature available, then it would have to be followed w/ "quoted from so and so's post", this so so said this, etc.

View 16 Replies

Stop Repeating Same Answers

May 25, 2009

there are 8 text boxes where user should put 8 answers, but when he type one answer in one text box it cant be found in some other text box.Basically when button is clicked there should be check for repeated answers.

View 3 Replies

Error When Unzipping File Using GZipStream(magic Number)

Jul 9, 2009

unzipping file using GZipStream.Heres the solution but i hope that i don't need to imports another dlls [URL] the zip files i compressed with 7z. and here the code...

[Code]...

View 8 Replies

If File Is An Image Using .Net Framework Not By Checking Magic Numbers

Apr 20, 2011

With all the smarts of actually loading images being done by the .net framework, seems like I shouldn't have to repeat it all in my code by checking for magic numbers, or using a hack like this:[code]Am I missing something obvious, like System.Drawing.IsImage(stream)?

View 1 Replies

Make A Bouncing Ball - Built Their Codes?

Dec 30, 2009

I am now trying to make a bouncing ball in vb 2008, ofc i looked at some guides first to see how they built their codes

Public Class Form1
Dim m_Dx As Integer
Dim m_Dy As Integer[code]....

As you see there are many variables

View 4 Replies

Move An Image (technically A Powerpacks Ball...)?

Oct 3, 2011

I'm attempting to move an image (technically a Powerpacks ball...).

Public Class Form1
Dim XSpeed As Decimal
Dim YSpeed As Decimal
Dim BallLocation As New Point(Ball.location.x, Ball.location.y)

[code].....

View 4 Replies

Set The Computer Player To Move According To The Ball's Position?

Nov 22, 2010

I'm coding the game timer, but am noticing that the gameBall is undeclared and don't see it in the tutorial.Private Sub gameTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gameTimer.Tick

[Code]...

View 5 Replies

VS 2005 : Make The Ball Bounce Around The Desktop?

Sep 3, 2009

Ive been experimenting with physics of objects in visual basic and what (a boucing ball) and Ive been wanting to take it the step further, make the ball bounce around the desktop. but how.

View 5 Replies

When Import Background My Ball Speed Slows Down?

Jan 17, 2010

I just finished working on my school vb project - breakout. As soon as i import background my ball speed slows down dramatically. I used 1.25mb bmp, 40kb jpg, and lower resolution copies of both but i get the same result. In my game i use bitmaps for bricks, platform and the ball along with a timer and draw e.graphics function. How can i illuminate the reduction of the speed of the ball when i add my background?

View 3 Replies

Displaying The Equation And Answers In A Listbox?

Apr 27, 2012

First off the listbox needs to show the equations for the number entered between 0 and 12 example:

1+1=2
1+2=3
1+3=4

[Code]....

View 7 Replies

Error With Compare Answers Function?

May 12, 2012

When Score exam is clicked, the answers from the keys file is read using ReadLine method 6 times to fill the Answer Array. then the users' answers and the answers from the keys will be paired up by calling "Compare_Answers" function in the RMV Global Module. and calculate the score and it will show on the main form.

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved