How Rich Are You in the World?
来源:互联网 发布:red5 fms nginx 编辑:程序博客网 时间:2024/05/20 18:55
HOW RICH ARE YOU?
Use the codes below ,you can find where you sit in the richest people list in world.
- Sub Showhowrichyouare()
- Getit InputBox("Please enter your annual income(USD)", "info", 6000)
- End Sub
- Sub Getit(ByVal myincome As Long) 'Input
- 'myincome = myincome * 0.145465 ' RMB to USD
- Dim i As Long, bindex As Long, sumx As Double, sumy As Double, sumxy As Double, sumx2 As Double
- Dim people, money, slope As Double, intb As Double, pos, percent, msg As String
- If myincome < 100 Then pos = 5780722892#: percent = 99.9: GoTo showmsg
- If myincome > 200000 Then pos = 107565: percent = 0.001: GoTo showmsg
- people = Array(0, 600000, 1200000, 3000000, 4500000, 5100000, 5395000, 5700000, 5940000, 5999990)
- money = Array(50, 400, 500, 850, 1486.67, 2182.35, 25000, 33700, 47500, 202000)
- For i = 0 To 9
- If myincome < money(i) Then bindex = i - 1: Exit For
- Next
- sumx = people(bindex) + people(bindex + 1)
- sumy = money(bindex) + money(bindex + 1)
- sumxy = people(bindex) * money(bindex) + people(bindex + 1) * money(bindex + 1)
- sumx2 = people(bindex) ^ 2 + people(bindex + 1) ^ 2
- slope = (2 * sumxy - sumx * sumy) / (2 * sumx2 - sumx ^ 2)
- intb = (sumy - slope * sumx) / 2
- pos = Round(6000000000# - ((myincome - intb) / slope) * 1000, 0)
- percent = Format((pos / 6000000000#) * 100, "0.00")
- showmsg:
- msg = "Your annual income is $" & myincome & " now" & vbCrLf & vbCrLf
- msg = msg & "You are the " & pos & " richest person in the world!" & vbCrLf & vbCrLf
- msg = msg & "You're in the TOP " & percent & "% richest people in the world!" & vbCrLf & vbCrLf & vbCrLf
- msg = msg & Right(Space(200) & "YOU", 2 * Round(100 - percent, 0)) & vbCrLf & Right(Space(200) & "↓", 2 * Round(100 - percent, 0)) & vbCrLf
- msg = msg & String(100, "*") & vbCrLf
- msg = msg & "<--POOREST------------------------------------THE WHOLE POPULATION OF THE WORLD!--------------------------------RICHEST-->"
- MsgBox msg, , "How Rich are you?"
- End Sub
It returns:
About The Source:
HOW RICH ARE YOU?
Every year we gaze enviously at the lists of the richest people in world.
Wondering what it would be like to have that sort of cash. But where
would you sit on one of those lists? Here's your chance to find out.
Just enter your annual income into the box below and hit 'show me the money'
- How Rich Are You in the World?
- There Are Only Four Jobs in the Whole World – Are You in the Right One?
- Clear Blogging: How People Blogging Are Changing the World and How You Can Join Them
- you are no in my world
- How the iPhone knows where you are
- How to share text to Message in the app you are building(iOS platform)
- how are you
- Who-are-the-top-Java-experts-in-the-world
- How to be the rich?
- You Are the One
- the way you are
- We Are The World
- How are you doing, Jane?
- hello , how are you today?
- 怎样回答“How are you”?
- 怎样回答 How are you?
- Can you refresh a document in the Notes client after changing a rich text field?
- [Ant] How the tasks are called in Ant?
- 实现浮动广告的代码
- printk( )函数
- 感受 Erlang(3)
- robot---百度百科
- Linq 第二天
- How Rich Are You in the World?
- 上传附件中文名问题的解决办法
- Writing Security Tools and Exploits
- Oracle数据导入导出imp/exp命令
- A Java Library of Graph Algorithms and Optimization (Discrete Mathematics and Its Applications)
- 四川一女教师被迫下跪向学生道歉后疯掉
- TypeAndRun--快速启动程序的工具
- Excel Hacks: Tips & Tools for Streamlining Your Spreadsheets
- CCNA: Cisco Certified Network Associate Study Guide: Exam 640-802