0% found this document useful (0 votes)
21 views

Machine Problem 3

This document provides instructions for a computer programming lab assignment to create a Rock Paper Scissors game in Matlab. Students are asked to write a program that allows two players to input either R, P, or S and displays who the winner is and the reason. The program should accept inputs in any case and provide sample output and test data to verify it is working correctly. The objectives are to familiarize students with the Matlab interface and basic commands.

Uploaded by

Kyung Madette
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Machine Problem 3

This document provides instructions for a computer programming lab assignment to create a Rock Paper Scissors game in Matlab. Students are asked to write a program that allows two players to input either R, P, or S and displays who the winner is and the reason. The program should accept inputs in any case and provide sample output and test data to verify it is working correctly. The objectives are to familiarize students with the Matlab interface and basic commands.

Uploaded by

Kyung Madette
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CS10-8L: Computer Programming Laboratory

Machine Problem #3: Rock Paper Scissors

Name: Score:

Section: Date:

OBJECTIVES
● To familiarize the students with the Matlab interface.

● To enable the students to use some basic commands.

MACHINE PROBLEM

Write a program that will simulate the Rock-Paper-Scissors game. Allow two players to input one at a time: (P or p)
for Paper, (R or r) for Rock, (S or s) for scissors. Your program should display who the winner is and the reason for
winning: Paper covers rock, Rock breaks scissors, and Scissors cut paper. Allow users to accept letter inputs
in any case. When you have completed your program and verification, use your program to complete the test data
table below. Provide the following comments: date, author, program description. (Include all possible inputs of
player 1 and player 2)

Sample Output:

Player 1 input:
P
Player 2 Input:
R

Player 1 wins the game because paper covers rock

Test Data:

Input Output
Player 1 Player 2 Winner Reason

p R p Paper covers rock

S p S Scissor cut paper

S R R Rock break scissor

Prepared by: Bon Ryan Fran


Prepared Date: June 20, 2023

You might also like