Anonymous
Anonymous asked in 電腦與網際網路程式設計 · 1 decade ago

VB實作題我不會寫 誰能救救我~~~

1.圓周長的公式是2*PI*r,PI是圓周率3.1415,r是半徑10、20、50,建立VB主控台應用程式,使用常數定義圓周率,然後計算各種半徑的圓周長。

2.建立VB主控台應用程式宣告美金匯率的常數為33,然後計算532美金換算成新台幣有多少?

3.在籃子中有250個蛋,一打是12個,用VB主控台應用程式計算250的蛋是幾打,還剩下幾個蛋。

4.向銀行借了50萬,年利率是18%,如果每年的利息都併入本金,及複利計算,建立VB主控台應用程式計算在10年後,本金和利息共需還多少錢。

5.變數X是5,Y是10,建立VB主控台應用程式計算數學運算式(X+Y)*(X-Y)的值。

程式我不太會寫>"<

徵一位會寫程式的高手救救我~~~

1 Answer

Rating
  • 鴨子
    Lv 6
    1 decade ago
    Favorite Answer

    1.

    Module Module1

    Sub Main()

    Const PI As Double = 3.1415

    Dim d As Double

    d = 2 * PI * 10

    Console.WriteLine("半徑=10, 則週長=" + d.ToString)

    d = 2 * PI * 20

    Console.WriteLine("半徑=20, 則週長=" + d.ToString)

    d = 2 * PI * 50

    Console.WriteLine("半徑=50, 則週長=" + d.ToString)

    Console.ReadKey()

    End Sub

    End Module

    2.

    Module Module1

    Sub Main()

    Const RATE As Double = 32

    Dim total As Double

    total = RATE * 532

    Console.WriteLine("532美金, 換算成新台幣=" + total.ToString)

    Console.ReadKey()

    End Sub

    End Module

    3.

    Module Module1

    Sub Main()

    Dim dozens As Integer

    Dim remainder As Integer

    dozens = 250 \ 12

    remainder = 250 Mod 12

    Console.WriteLine(dozens.ToString + " 打, 剩 " + remainder.ToString + " 個")

    Console.ReadKey()

    End Sub

    End Module

    4.

    Module Module1

    Sub Main()

    Dim total As Double

    total = 500000.0 * (1 + 0.18) ^ 10

    Console.WriteLine(total.ToString)

    Console.ReadKey()

    End Sub

    End Module

    5.

    Module Module1

    Sub Main()

    Dim X As Integer = 5

    Dim Y As Integer = 10

    Dim Result As Integer

    Result = (X + Y) * (X - Y)

    Console.WriteLine(Result.ToString)

    Console.ReadKey()

    End Sub

    End Module

Still have questions? Get your answers by asking now.