
# Need help creating this pseudocode into a functioning PYTHON code.
Sample Pseudocode:
// main module
Module main()
// Declare input variables
Declare String inputName, String inputType, Integer inputAge
// class variable to hold a pet
Declare Pet Animal
// create a Pet object
Set Animal = new Pet()
// Get values for a pet
Display “Enter a pet name:”
Input inputName
Animal.setName(inputName)
Display “Enter a pet type:”
Input inputType
Animal.setType(inputType)
Display “Enter a pet age:”
Input inputAge
Animal.setAge(inputAge)
// Show values for this pet
Display “The pet name is “,Animal.getName()
Display “The pet type is “,Animal.getType()
Display “The pet age is “,Animal.getAge()
End Module
Class Pet
// Fields
Private String name
Private String type
Private Integer age
// Constructor
Public Module Pet(String n, String t, Integer a)
Set name = n
Set type = t
Set age = a
End Module
// Mutators
Public Module setName(String n)
Set name = n
End Module
Public Module setType(String t)
Set type = t
End Module
Public Module setAge(Integer a)
Set age = a
End Module
// Accessors
Public Function String getName()
Return name
End Function
Public Function String getType()
Return type
End Function
Public Function getAge()
Return age
End Function

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

- JAVA:arrow_forwardlemy Basics structions Nickname Problem program.py > Type your answer to "Nickname"r here. Write a program that asks the user for their nickname, then prints out a welcome message like this: What is your nickname? pikachu Welcome, I will call you 'pikachu'. Watch out for the punctuation and quotes! A Submissions Output You don't have any submissions or saved code.arrow_forwardplease code in python You place a pawn at the top left corner of an n-by-n chess board, labeled (0,0). For each move, you have a choice: move the pawn down a single space, or move the pawn down one space and right one space. That is, if the pawn is at position (i,j), you can move the pawn to (i+1,j) or (i+1, j+1). Ask the user for the size of a chessboard, n (integer). Find the number of different paths starting from (0,0) that the pawn could take to reach each position on the chess board. For example, there are two different paths the pawn can take to reach (2,1). Look at the diagrams below to convince yourself of this. You can see the four paths that you can take by move 2. Start -> Move 1 -> Move 2 (0,0) -> (1,0) -> (2,1) (0,0) -> (1,0) -> (2,0) (0,0) -> (1,1) -> (2,1) (0,0) -> (1,1) -> (2,2) Print the board with the number of ways to reach each square labeled as shown below. For example: Enter a board size: 4 1 0 0 0 1 1 0 0 1 2 1 0 1 3 3 1arrow_forward
- What should a programmer be especially aware of when programming with arrays? Syntax errors If-then-else statements Modularization Using an Out of Bounds array subscriptarrow_forwardComputer Science Part C: Interactive Driver Program Write an interactive driver program that creates a Course object (you can decide the name and roster/waitlist sizes). Then, use a loop to interactively allow the user to add students, drop students, or view the course. Display the result (success/failure) of each add/drop.arrow_forwardInteger userValue is read from input. Assume userValue is greater than 1000 and less than 99999. Assign tensDigit with userValue's tens place value. Ex: If the input is 15876, then the output is: The value in the tens place is: 7 2 3 public class ValueFinder { 4 5 6 7 8 9 10 11 12 13 GHE 14 15 16} public static void main(String[] args) { new Scanner(System.in); } Scanner scnr int userValue; int tensDigit; int tempVal; userValue = scnr.nextInt(); Your code goes here */ 11 System.out.println("The value in the tens place is: + tensDigit);arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





