Home > Software engineering >  There are two problem is not a great god for help
There are two problem is not a great god for help

Time:10-06

The first topic

CodePudding user response:

The second

CodePudding user response:

1
 Private Function Get_Years (ByVal Amount As Double, ByVal Interrest As Double) As Long 
Dim As Long, I n the As a Double
If the Amount=0 Or interrest=0 Then the Exit Function

N=Amount
Do Until n & gt;=1000000
N=n * (1 + Interrest)
I=I + 1
Loop

Get_Years=I
End the Function

Private Sub Command1_Click ()
Text3="In" & amp; Get_Years (Val (Text1), Val (Text2)) & amp; "Years you will have a m letters."
End Sub

CodePudding user response:

2
 Private Sub Command1_Click () 
Dim n As a Double, m As a Double

N=Val (Text1) - 40
M=Val (Text2)

Text3=n
Text4=Format (40 * m + n * m * 1.5, "standard")
End Sub

CodePudding user response:

The first question should not be used more than BanZhi mathematical algorithm?
 Private Function Get_Years2 (ByVal Amount As Double, ByVal Interrest As Double) As Long 
Dim As Double y
If the Amount=0 Or Interrest=0 Then the Exit Function

Y=Log (1000000/Amount)/Log (1 + Interrest)

Get_Years2=RoundUp (y)
End the Function

The Function RoundUp (ByVal v As Double) As a Double
RoundUp=Fix (v) + Sgn (v - Fix (v))
End the Function

CodePudding user response:

This problem...
Simple interest and compound interest is not clear, changed I also don't lift the table.

The second question...

CodePudding user response:

Out of this problem is the monkey sent to come over?

CodePudding user response:

So according to the method of, if not, breaking up the family of glass,

CodePudding user response:

The
reference 4 floor Tiger_Zhao reply:
1 should not be used more than BanZhi mathematical algorithm?
 Private Function Get_Years2 (ByVal Amount As Double, ByVal Interrest As Double) As Long 
Dim As Double y
If the Amount=0 Or Interrest=0 Then the Exit Function

Y=Log (1000000/Amount)/Log (1 + Interrest)

Get_Years2=RoundUp (y)
End the Function

The Function RoundUp (ByVal v As Double) As a Double
RoundUp=Fix (v) + Sgn (v - Fix (v))
End the Function
ha ha, in computer environment, sometimes is more effective in circulation way, in fact, at the bottom, your multiplication is probably addition, big shift, and it is binary, take an examination of the topic, take an examination of is the computer thinking,

CodePudding user response:

Such "computer thinking" is only suitable for assembly programmer,
Mathematics as long as the programmer BanZhi head level, take count also strips records and have minds!

CodePudding user response:

CodePudding user response:

references 9 f Tiger_Zhao response:
"computer thinking" as only suitable for assembly programmer,
Mathematics as long as the programmer BanZhi head level, take count also strips records and have minds!
to see a lot of nonlinear algorithm implementation, you will see,
In fact, the computer displays the log operation is equal to the complex, such as need more resources, in some cases, the operation of the bottom, is achieved by circular approximation, but in a high-level programming interface to look "tall",

You can try it, and in some less resources environment, such as single chip microcomputer, using circular approximation faster than the implementation of complex operation code might,

Computer is not only mathematics, it can solve mathematical problems, but it is a faster machine, for example, the calculation of PI, not any more advanced algorithm was realized in the computer, but it can be faster circulation,

Elementary course of computer principle, there is a part of the familiar with using computers is to teach beginners circular function to achieve a variety of algorithms, the most common example, is the root, in the computer, we do not use the square root algorithm in the math class, but the loop approximation algorithm,

I always thought that the tiger is a veteran in computers veteran, this speech to my great surprise,

CodePudding user response:

11 references of123 response:
Quote: references 9 f Tiger_Zhao response:

Such "computer thinking" is only suitable for assembly programmer,
Mathematics as long as the programmer BanZhi head level, take count also strips records and have minds!
to see a lot of nonlinear algorithm implementation, you will see,
In fact, the computer displays the log operation is equal to the complex, such as need more resources, in some cases, the operation of the bottom, is achieved by circular approximation, but in a high-level programming interface to look "tall",

You can try it, and in some less resources environment, such as single chip microcomputer, using circular approximation faster than the implementation of complex operation code might,

Computer is not only mathematics, it can solve mathematical problems, but it is a faster machine, for example, the calculation of PI, not any more advanced algorithm was realized in the computer, but it can be faster circulation,

Elementary course of computer principle, there is a part of the familiar with using computers is to teach beginners circular function to achieve a variety of algorithms, the most common example, is the root, in the computer, we do not use the square root algorithm in the math class, but the loop approximation algorithm,

I always thought that the tiger is a veteran in computers veteran, this speech to my great surprise,

You surprise me?
If is a rookie at graduate students, teaching material by a gang or memory (specialty is single chip microcomputer to K of microcomputer) old written by experts, so there is no quantitative emphasis on efficiency, less memory, less time can also understand,
But as a long-term working experience veteran, efficiency first consider is the output/input,
If there is off-the-shelf modules available but in 0.1 seconds, custom-made estimation can be dropped to 0.01 seconds, even worse one order of magnitude or choose ready-made,
At least, in the most advanced language development efficiency indicates performance,

A mathematical code is easier to maintain;
And a strange algorithm code looks something like this - this sentence what mean? Nima document? Nima how code and documentation that is not the same!
Packaging good high-level language is the basic algorithm, when a black box with line,
Software engineering is not in order to better division of labor cooperation understands everything,

CodePudding user response:

Your code will only be out so weak-minded exam, China education
ah

CodePudding user response:

Out of the question, I'm afraid just in order to make students master basic grammar
  • Related