473,382 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Hallo!

PLEASE RUN THE FOLLOWING FULL PROGRAM IN VB 5 AND CORRECT IT.
Private Sub Command1_Click()
Dim x, y, z, w, v, a, b As Double
MsgBox "This program will find the real solutions of the equation x^4+ax+b=0"
MsgBox "give a"
InputBox a
MsgBox "give b"
InputBox b
If a = 0 Or b = 0 Then
MsgBox "The solutions can not be given by that program!"
Else
MsgBox "ok please wait...."
End If
If a ^ 4 - (256 * b ^ 3) / 27 >= 0 Then
z = ((a ^ 2 + (a ^ 4 - (256 * b ^ 3) / 27) ^ 1 / 2) / 2) ^ 1 / 3 + ((a ^ 2 - (a ^ 4 - (256 * b ^ 3) / 27) ^ 1 / 2) / 2) ^ 1 / 3
Else
MsgBox "The solutions can not be given by that program!"
End If
If z >= 0 And -z - (2 * a) / z ^ 1 / 2 >= 0 Then
x = (z ^ 1 / 2 + (-z - (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
w = (z ^ 1 / 2 - (-z - (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
Else
If z >= 0 And -z + (2 * a) / z ^ 1 / 2 >= 0 Then
y = (z ^ 1 / 2 + (-z + (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
v = (z ^ 1 / 2 - (-z + (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
Else
If z < 0 Then
MsgBox "There are no other real solutions"
End If
End If
End If
MsgBox "The first solution is" 'x'
MsgBox "The second solution is" 'w'
MsgBox "The third solution is" 'y'
MsgBox "The fourth solution is" 'v'
MsgBox "There is no other real solution"
MsgBox "Thanks for using that program"
End Sub
THANKS
Aug 8 '08 #1
1 958
kadghar
1,295 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. msgbox "solution is " 'x'
This won't do. Remember that

' <--- means comment

So remove them.

Expand|Select|Wrap|Line Numbers
  1. msgbox "the solution is " & x
HTH

NOTE: Please read the Posting Guidelines
Aug 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
3
by: teo | last post by:
I have a text. Inside the text the "hallo" word occurs five time. I need to replace "hallo" with "hallo world". Unfortunately I get this: hallo world world world world world
0
by: Jeroen den Harder | last post by:
hoi !! *** Sent via Developersdex http://www.developersdex.com ***
14
by: japhethngura | last post by:
This is to inform all the members that I have now joined the discussion group. Let us make it as productive as possible.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.