Find Jobs
Hire Freelancers

Simple Visual Basic Programming Assignment

$30-5000 USD

Đã hủy
Đã đăng vào hơn 17 năm trước

$30-5000 USD

Thanh toán khi bàn giao
A few simple beginners Visual Basic projects to be completed using a console application. Projects include making a rock, paper scissors game and making and developing a program to solve the following: Today I will give you a penny, tomorrow I will give you two pennies. I will then keep doubling the amount that I give to you until the end of the month is reached. How much will you have? Full detail including example code can be seen in the deliverables. The assignment should not go much beyond basic coding as it's aim is to introduce the fundamentals such as case structures, algorithms etc. To be completed asap ## Deliverables Introduction to Programming Exercise One Design a psuedocode algorithm that will solve the following problem: Today I will give you a penny, tomorrow I will give you two pennies. I will then keep doubling the amount that I give to you until the end of the month is reached. How much will you have? Things to consider What is the current day? Day 1, 2 or maybe 17. What is the current Month (How many days? 28, 29, 30, 31) Exercise Two Based upon your algorithm from exercise one, and the techniques presented from previous lectures and practical exercises, write a program that will calculate and display the results (don’t worry about formatting output for now). Practical Programming Session - Week Six • Examine the program code on the following page. (Note I have taken most of the program comments out to save space). • The changes that you should note have been made to function and procedure calls in “Main()??. A new parameter is now present “MonthDays??. See if you can establish why we need this variable. • Most of the changes have been made in the “GetUserInput procedure??. I have given you a start (idea) of how to process the days and months that are entered by the user. • Now also present, is minimal error checking (this will need to be improved eventually. • The program actually runs. But, is correct? (Testing and Debugging). • See if you can use/improve this code to fit into your current pennies application • Remember to “solve the problem/logic “ on paper first before you start programming ??" you will get lost and confused in the logic if you do not understand the “paths?? to solving the problem before you start programming. • What is missing? • How can we improve the design of the program? • Is it solving our problem? • Think about error checking. Sub Main() Dim Day, Month, MonthDays, Leap As Integer Dim Result As Long Call GetUserInput(Day, Month, MonthDays, Leap) Result = PennyCalc(Day, Month, MonthDays, Leap) Call DisplayResults(Day, Month, Leap, Result) [login to view URL]("Press enter to Quit") [login to view URL]() End Sub Sub GetUserInput(ByRef Day As Integer, ByRef Month As Integer, ByRef MonthDays As Integer, ByRef Leap As Integer) ‘******************************************************************* Dim LeapTemp As Integer [login to view URL]() ' Clear the screen [login to view URL]("**************************************") [login to view URL]("* *") [login to view URL]("* Get The User Input *") [login to view URL]("* *") [login to view URL]("**************************************") Leap = LeapCalc(LeapTemp) [login to view URL]("Enter the Month as a number") Month = [login to view URL]() 'get the Month number from the user [login to view URL]("Enter the Day of the month as a number") Day = [login to view URL]() 'get the day number from the user If Month = 2 And Leap = 0 Then If Day > 28 Then [login to view URL]() [login to view URL]("Please enter a valid number for February") [login to view URL]("Press the Enter key to retry") [login to view URL]() Call GetUserInput(Day, Month, MonthDays, Leap) 'force the user to re-enter End If End If If Month = 2 And Leap = 1 Then MonthDays = 29 End If Select Case Month Case 4, 5, 9, 11 MonthDays = 30 Case 1, 3, 5, 7, 8, 10, 12 MonthDays = 31 End Select End Sub Function PennyCalc(ByRef Day As Integer, ByRef Month As Integer, ByRef MonthDays As Integer, ByRef Leap As Integer) As Long Dim counter As Integer Dim PennySum As Long PennySum = 1 [login to view URL]("Sum is = to " & PennySum) For counter = Day To MonthDays PennySum = PennySum * 2 [login to view URL]("Sum is = to " & PennySum) Next Return PennySum End Function ‘********************************************************************** Sub DisplayResults(ByRef Day As Integer, ByRef Month As Integer, ByRef Leap As Integer, ByRef Result As Long) [login to view URL]("The Day of the month is = Day " & Day) [login to view URL]("The Month number = " & Month) [login to view URL]("Leap Status = " & Leap) [login to view URL]("The Total = " & Result) End Sub *********************************************************************** Function LeapCalc(ByRef Leap As Integer) As Integer Return 0 End Function 1. Revisit the design and amend where necessary. 2. Complete the GetUserInput Procedure 3. Complete the LeapCalc Function Week 9 to 11 - Practical Work You are required to develop a program which aims to emulate the popular “playground?? game called “Scissors ??" Paper ??" Stone??. The game will involve 2 players ??" the computer and the user. The Rules of Scissors-Paper- Stone: Both players (in this case the computer and you) select (without each other knowing) a choice between one and three: 1. Scissors, 2. Paper or 3. Stone,. If both players picked the same number, the result is draw. Otherwise one of the players wins, that is, considering the rules of the game below: Stone beats Scissors (because stone blunts scissors), Scissors beat Paper (because scissors cuts paper) and Paper beats Stone (because paper wraps stone) The winner gets one point. Of course, in the computer game, the choices are decided by random numbers (see the example procedure on the VLE for week nine or consult your book for random number generation), which are generated by the program, in the range 1 to 3, i.e. 1- for scissors, 2- for paper and 3- for stone. The program must (besides the basic functionality) • Distinguish between entries ??" that is display user names (computer and opponent) • Inform the user of the result of each game, e.g. win, draw, lose etc. Also the reason for the latter.(“Because scissors cuts paper?? etc) • Have a maximum of ten games per session ??" followed by the option “do you want to continue?? • Display the number of games played in the current session and who won the overall session. ## Platform Visual Basic Express - Console Application
Mã dự án: 3959254

Về dự án

4 đề xuất
Dự án từ xa
Hoạt động 17 năm trước

Bạn muốn kiếm tiền?

Lợi ích khi chào giá trên Freelancer

Thiết lập ngân sách và thời gian
Nhận thanh toán cho công việc
Phác thảo đề xuất của bạn
Miễn phí đăng ký và cháo giá cho công việc
4 freelancer chào giá trung bình $48 USD cho công việc này
Avatar người dùng
See private message.
$123,25 USD trong 3 ngày
5,0 (12 nhận xét)
4,2
4,2
Avatar người dùng
See private message.
$11,05 USD trong 3 ngày
4,8 (28 nhận xét)
3,1
3,1
Avatar người dùng
See private message.
$25,50 USD trong 3 ngày
4,8 (5 nhận xét)
2,3
2,3
Avatar người dùng
See private message.
$34 USD trong 3 ngày
0,0 (5 nhận xét)
0,0
0,0

Về khách hàng

Cờ của UNITED KINGDOM
Leigh, United Kingdom
5,0
4
Thành viên từ thg 4 20, 2007

Xác thực khách hàng

Cảm ơn bạn! Chúng tôi đã gửi email chứa đường link để bạn lấy tín dụng miễn phí.
Đã xảy ra lỗi trong khi gửi email của bạn. Hãy thử lại.
Người Dùng Đã Đăng Ký Tổng Số Việc Đã Đăng
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Đang tải xem trước
Đã cấp quyền truy cập vị trí.
Phiên đăng nhập của bạn đã hết hạn và bạn đã bị đăng xuất. Hãy đăng nhập lại.