Homework

Homework

# There are many lottery schemes available across the world.

Customer Question
Write a MIPS Assembly language program...
There are many lottery schemes available across the world. Write a MIPS Assembly language
program that will calculate the odds of winning the Jackpot prize.
For example:
o The Euro Millions lottery requires matching 5 numbers from a pool of 50
numbers and matching 2 numbers from a second pool of 11 numbers.
o The Mega Millions lottery requires matching 5 from 75 and 1 from 15.
o The Thunderball lottery requires matching 5 from 39 and matching 1 from 14.
o The PowerBall lottery requires matching 5 from 69 and 1 from 26.
o The Lotto lottery requires matching 6 from 59.
The subroutine example on the following page, calculates the Factorial of an input integer.
Starting with the code in the example, write a correct program in MIPS - QtSpim assembly
language that:
1) Calculates the odds of winning any of the lottery jackpot grand prizes.
2) The calculated value is to be displayed on the QtSpim console screen with an
appropriate commentary text. Such as “The odds are 1 in nnnn.”
3) The program is to accept as input:
 An integer representing the large pool of possible numbers.
 A second integer representing the count of numbers to be selected from
the large pool.
 An integer representing the size of the second pool of numbers.
 A fourth integer representing the count of numbers to be selected from the
second pool.
4) Test your program by calculating the odds of choosing a set of 2 numbers from
a pool of 6 numbers. The value is “1 in 15”. Test other combinations.
Note: Because the largest MIPS single precision integer value will not hold the value of more
than 12!, you will need to use some algebra to simplify the calculations. With the
simplifications, all of the math can be done using the integer multiply and divide instructions.
Your program should display a message when it stops.
Use the System Service calls on page A-44 of the textbook for the input and output.
The work products of this assignment are:
1) A copy of the source program text file.
2) Screen captures showing test output results.# ***** n, in register \$a0;
# ***** n! and stores the result in register \$v0
factrl: sw \$ra, 4(\$sp) # ***** the return address
sw \$a0, 0(\$sp) # ***** the current value of n
addi \$sp, \$sp, -8 # ***** stack pointer
slti \$t0, \$a0, 2 # ***** 1 iteration, n=0 or n=1; n!=1
beq \$t0, \$zero, L1 # ***** calculate n(n-1)!
addi \$v0, \$zero, 1 # *****=1; n!=1
jr \$ra # ***** multiply
L1: addi \$a0, \$a0, -1 # ***** = n-1
jal factrl # ***** (n-1)!
addi \$sp, \$sp, 8 # ***** the stack pointer
lw \$a0, 0(\$sp) # ***** saved (n-1)
lw \$ra, 4(\$sp) # ***** return address
mul \$v0, \$a0, \$v0 # ***** (n)*(n-1)
jr \$ra # ***** value n!
# ***** Snyder 16 May 2016
######### ***** of the subroutine
Submitted: 1 year ago.Category: Homework
Show More
Show Less
6/29/2016
Tutor: Ingo U, Software Engineer replied 1 year ago
Ingo U, Software Engineer
Category: Homework
Satisfied Customers: 755
Experience: Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL
Verified
You can view this answer by clicking here to Register or Login and paying \$3.
Ingo U, Software Engineer
Category: Homework
Satisfied Customers: 755
755 Satisfied Customers
Experience: Over 25 years experience in software development. Expert in Microsoft .Net, C#, C++, VB, SQL

Ingo U is online now

A new question is answered every 9 seconds

• Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
• Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

## What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

## Meet the Experts:

LogicPro

Engineer

5,672 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Tutor

4,549 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

M.S.W. Social Work

2,635 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

Chartered Accountant

2,158 satisfied customers

Experience with chartered accountancy

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
Which if the following is not included unpaid-in capital?
which if the following is not included unpaid-in capital? common stock pain-in capital-donations stock dividend distributable appropriation per loan agreement … read more
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,158 satisfied customers
This question is just for Dr. Kakonge. This purpose is to
Hello. This question is just for Dr. Donna Kakonge.This purpose is to pay the payment to Dr. Donna Kakonge on 06/16/2017 again because of something wrong about payment on 06/16/2017.The question on 06… read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
A recent survey found that 73% of all adults over 50 wear
A recent survey found that 73% of all adults over 50 wear sunglasses for driving. In a random sample of 20 adults over 50, what is the mean and standard deviation of those that wear sunglasses?… read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
Is anyone familiar with Excel??? The link below will take
Is anyone familiar with Excel??? The link below will take you to my question. It is due 02/14/10 Sunday night , but the sooner the better. You will see "1: Five-Year Sales Projections" that is what I … read more
Stephen, MBA
Master's Degree
166 satisfied customers
160 Word min.: Consider the internal control process
160 Word min.: Consider the internal control process required by the Sarbanes-Oxley Act. Do you think the expenses of implementing better internal controls are offset by the benefits of having the con… read more
Jane T(LLC)
Master's Degree
18 satisfied customers
I would ask this in homework but I think this is out of
Hi,I would ask this in homework but I think this is out of their area of expertise. How much to answer these 40 electrician trade school questions from Penn foster. This is their NEC graded project wh… read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
I have questions on teh fundamental accounting principles
I have questions on teh fundamental accounting principles book nineteenth edition. chapter 11. if you do hit me up… read more
Brittany
Bachelor\u0027s Degree
102 satisfied customers
I see you have already done this project but i dont see the
hello i see you have already done this project but i dont see the essay part of it or the brainstorm page it needed done,i am in need of these asap,if you can contact me that would be great,thnx “Evil… read more
Bachelor\u0027s Degree
77 satisfied customers
I need help on how to figure out this problem, I am having
Hello, I need help on how to figure out this problem … read more
GLENN
Master of Mathematics
328 satisfied customers
How many words per minute does the average person think? How
Good afternoon, how many words per minute does the average person think? … read more
GLENN
Master of Mathematics
328 satisfied customers
Section 1 – Objectives: Provide a brief summary of the
Section 1 – Objectives: Provide a brief summary of the project. • Section 2 – Task 1: Basic Web Tracking Mechanism: Summarize your efforts to investigate web tracking, including the screenshots you to… read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
I need help implementing expectation maximization algorithm
I need help implementing expectation maximization algorithm in python … read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
I have 3 more if you want them, i have to pick a heroine,
i have 3 more if you want them, i have to pick a heroine, and do these assignments, let me know, and let me know what its worth, when this one is done, i will send you the other two, and pay seperatel… read more
Bachelor\u0027s Degree
77 satisfied customers
I need help with advanced macroeconomics. I'm having trouble
I'm having trouble with the IS-MP-PC model, showing what would happen if the FFR would be increased, and also if there were to be a tax reform. … read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
With a minimum word count of 130: Do you believe business
With a minimum word count of 130: Do you believe business enterprise should be regulated by the federal government or that the marketplace should determine price? Explain your response.… read more
Experienced Teacher
Bachelor\u0027s Degree
394 satisfied customers
Is there any help for Linux beginners testout chapter exams.
is there any help for Linux beginners testout chapter exams … read more
Dr. Donna Kakonge
Doctor of Education
185 satisfied customers
Prepare 10 column work sheet for fiscal year 2005 starting
Manal Elkhoshkhany
Tutor
Foundation classes for MBA
4,549 satisfied customers
Need an SQL query written that will create a row for every
Need an SQL query written that will create a row for every possible date. I need it to take all invoices, payments and exchange rates and create a row for each record so that it can be filtered by exa… read more
The-PC-Guy
Bachelor\u0027s Degree
628 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less