Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSc 110 Avatar Many of you have probably selected or created an avatar, perhaps for a video-game or a profile image. There are also general-

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

CSc 110 Avatar Many of you have probably selected or created an avatar, perhaps for a video-game or a profile image. There are also general- purpose avatar creators online, such as avatarmaker.com. These tools can be used to create an avatar for use on various online In this assignment, you will be writing a console-based avatar creation tool. The program that you build will allow the user to build a custom avatar, or select from 3 pre-designed ones. The avatars that this program will create will not be of just a face, but rather an avatar body. All of the interaction for this program will happen on the command-line. Part of the purpose of this PA is to get you to use and better understand functions, parameters, if-statements, and while-loops. Name your program avatar.py Program Behavior The program will begin with a title and then a prompt to select/create an avatar: -AVATAR- Select an Avatar or create your own: This prompt will wait user input. At this point, the user can do one of several things: . Type exit to end the program without printing out an avatar lypecustom to begin the custom avatar creation interface. Choose from one of three pre-defined avatars. The names of the three pre-defined avatars are Deff, Adam, and Chris If anything other than exit,Custom, Deff, Adam, or Chrisientered, the program will just repeat the question until a valid input is entered. After the name is entered, the avatar is printed and then the program ends. Jeff, Adam, and Chris are shown below. If one of these is selected, you should print out this exact character and then the program can end Jeff Adam Chris Chris BTTTT ITTTTe I N I AN I N Take a close look at the above avatars. There are many similarities, but also some key differences. The differences of note are .All of then have a similar cap on, but one is a top-hat, one is a cam to the right, and the other is facing forward. .They all have the same basic face structure, but with two types of hair (single-quotes and double-quotes) showing below the hat, and differing eyes. Similar neck/torso style, but with varying height Similar arms, but wit Similar legs, but with varying lengths and shoes. . h varying characters used. . . If custom is selected, then the program should prompt the user for a number of look customization options. There are 7 total options to select, and the program should ask for the inputs one-by-one. The prompts should look as follows (example values shown after the question-marks). Select an Avatar or create your own: custom Answer the following questions to create a custom avatar Hat style? right Character for eyes? Shaggy hair (True/False) Arm style? Torso length? Leg length (1-4)? Shoe look? This sequence of inputs should produce this avatar in your progrdm, you should wrire d Tuncrlon That allows you to print our rhese tnree Sub-shidpes. You should wrire one Tuncrion Tor the upward-facing arrow, one for the downward-facing arrow, and one to prnt any number of rows of functions should take one parameter. The two arrow functions should take the character that the arrow should be made up of as a parameter. The row function should accept an integer, whic Each of these ermine the number of rows to print Restrictions You should follow the style guide You must have a main function No function should be longer than 30 lines, including comments You should have at least 4 purposeful functions . . o One for the up-arrow o One for the down arrow o Amain function You may not have any code that is not in a function, other than a call to main Examples Enter shape to display: plumbbob Enter arrow character: Enter shape to display: house Enter arrow character: Enter shape to display: Enter shape to display: house Enter arrow character: Enter row-area height: Enter row-area height: Enter row-area height: There will be additional test cases on Gradescope. Turning it In This program is due Tuesday, February 12th at 7:00pm. Turn it in on Gradescope. You should get your submission to pass as many of the test cases as possible. Also, ensure that your code conforms to the code style requirements. Eye Character Pretty simple- controls which character should be used for the eyes. The user should enter just one character, not a long string. Arm Style This input should be a single character, as with the eyes. This character will be used for the arm of the avatar.g is always used for the hand, and L-1) is always used for the body portion. The entered character should only change the actual arm component Torso Length Controls the length (height) of the torso. The value entered should be any positive integer. Below are examples of various torso lengths. 3 5 7 Leg Length Controls the length (height) of the legs. The value entered should be a positive integer between 1 and 5. Below are examples of the various leg length possibilities. 2 3 4 II NW I N I N The input here should be a string that is exactly 5 characters long. That is the amount of space allocated for shoes. There can be empty-spaces in the string. The shoe style provided should be used for both the left and right shoe. Development Strategy Perhaps you've noticed by now, but there are a lot of "chunks" of predefined and custom avatars that are similar. For example, all of the avatars have torso sections, but the height of them varies. All of the avatars have the same face structure, but the eyes and hair can change Shoes The input here should be a string that is exactly 5 characters long. That is the amount of space allocated for shoes. There can be empty-spaces in the string. The shoe style provided should be used for both the left and right shoe. Development Strategy Perhaps you've noticed by now,but there are a lot of "chunks" of predefined and custom avatars that are similar. For example, all of the avatars have torso sections, but the height of them varies. All of the avatars have the same face structure, but the eyes and hair can change You should write a function that is responsible for printing each "chunk" of the avatar. Thus, your program must have at least six functions to receive full points: A main function, and a function for each of the following chunks: the hat, face, arms, torso, and legs. The parameters of each function should be the values that control the look For example, you could write a function called def hat (direction)B, where the direction is a string indicating which style to print. Within the function, you can have if-statements that allow different styles to be printed. For the face, you could create a function named def face(hair, eyes)B. This function will have the standard face shape print out, but use the hair and eyes parameters to change those specific parts of the face. You should end up with a function for each part of the body. See the differ tool and/or Gradescope for examples of complete runs. Restrictions You are not allowed to use any string multiplication on this program. For the torso height and legs, you should try to use while- loops. Also, all of your code should be organized into functions. The only code that may not be in a function is a call to ain You are not allowed to have any global variables. You also should not use the ex function for this PA. CSc 110 Avatar Many of you have probably selected or created an avatar, perhaps for a video-game or a profile image. There are also general- purpose avatar creators online, such as avatarmaker.com. These tools can be used to create an avatar for use on various online In this assignment, you will be writing a console-based avatar creation tool. The program that you build will allow the user to build a custom avatar, or select from 3 pre-designed ones. The avatars that this program will create will not be of just a face, but rather an avatar body. All of the interaction for this program will happen on the command-line. Part of the purpose of this PA is to get you to use and better understand functions, parameters, if-statements, and while-loops. Name your program avatar.py Program Behavior The program will begin with a title and then a prompt to select/create an avatar: -AVATAR- Select an Avatar or create your own: This prompt will wait user input. At this point, the user can do one of several things: . Type exit to end the program without printing out an avatar lypecustom to begin the custom avatar creation interface. Choose from one of three pre-defined avatars. The names of the three pre-defined avatars are Deff, Adam, and Chris If anything other than exit,Custom, Deff, Adam, or Chrisientered, the program will just repeat the question until a valid input is entered. After the name is entered, the avatar is printed and then the program ends. Jeff, Adam, and Chris are shown below. If one of these is selected, you should print out this exact character and then the program can end Jeff Adam Chris Chris BTTTT ITTTTe I N I AN I N Take a close look at the above avatars. There are many similarities, but also some key differences. The differences of note are .All of then have a similar cap on, but one is a top-hat, one is a cam to the right, and the other is facing forward. .They all have the same basic face structure, but with two types of hair (single-quotes and double-quotes) showing below the hat, and differing eyes. Similar neck/torso style, but with varying height Similar arms, but wit Similar legs, but with varying lengths and shoes. . h varying characters used. . . If custom is selected, then the program should prompt the user for a number of look customization options. There are 7 total options to select, and the program should ask for the inputs one-by-one. The prompts should look as follows (example values shown after the question-marks). Select an Avatar or create your own: custom Answer the following questions to create a custom avatar Hat style? right Character for eyes? Shaggy hair (True/False) Arm style? Torso length? Leg length (1-4)? Shoe look? This sequence of inputs should produce this avatar in your progrdm, you should wrire d Tuncrlon That allows you to print our rhese tnree Sub-shidpes. You should wrire one Tuncrion Tor the upward-facing arrow, one for the downward-facing arrow, and one to prnt any number of rows of functions should take one parameter. The two arrow functions should take the character that the arrow should be made up of as a parameter. The row function should accept an integer, whic Each of these ermine the number of rows to print Restrictions You should follow the style guide You must have a main function No function should be longer than 30 lines, including comments You should have at least 4 purposeful functions . . o One for the up-arrow o One for the down arrow o Amain function You may not have any code that is not in a function, other than a call to main Examples Enter shape to display: plumbbob Enter arrow character: Enter shape to display: house Enter arrow character: Enter shape to display: Enter shape to display: house Enter arrow character: Enter row-area height: Enter row-area height: Enter row-area height: There will be additional test cases on Gradescope. Turning it In This program is due Tuesday, February 12th at 7:00pm. Turn it in on Gradescope. You should get your submission to pass as many of the test cases as possible. Also, ensure that your code conforms to the code style requirements. Eye Character Pretty simple- controls which character should be used for the eyes. The user should enter just one character, not a long string. Arm Style This input should be a single character, as with the eyes. This character will be used for the arm of the avatar.g is always used for the hand, and L-1) is always used for the body portion. The entered character should only change the actual arm component Torso Length Controls the length (height) of the torso. The value entered should be any positive integer. Below are examples of various torso lengths. 3 5 7 Leg Length Controls the length (height) of the legs. The value entered should be a positive integer between 1 and 5. Below are examples of the various leg length possibilities. 2 3 4 II NW I N I N The input here should be a string that is exactly 5 characters long. That is the amount of space allocated for shoes. There can be empty-spaces in the string. The shoe style provided should be used for both the left and right shoe. Development Strategy Perhaps you've noticed by now, but there are a lot of "chunks" of predefined and custom avatars that are similar. For example, all of the avatars have torso sections, but the height of them varies. All of the avatars have the same face structure, but the eyes and hair can change Shoes The input here should be a string that is exactly 5 characters long. That is the amount of space allocated for shoes. There can be empty-spaces in the string. The shoe style provided should be used for both the left and right shoe. Development Strategy Perhaps you've noticed by now,but there are a lot of "chunks" of predefined and custom avatars that are similar. For example, all of the avatars have torso sections, but the height of them varies. All of the avatars have the same face structure, but the eyes and hair can change You should write a function that is responsible for printing each "chunk" of the avatar. Thus, your program must have at least six functions to receive full points: A main function, and a function for each of the following chunks: the hat, face, arms, torso, and legs. The parameters of each function should be the values that control the look For example, you could write a function called def hat (direction)B, where the direction is a string indicating which style to print. Within the function, you can have if-statements that allow different styles to be printed. For the face, you could create a function named def face(hair, eyes)B. This function will have the standard face shape print out, but use the hair and eyes parameters to change those specific parts of the face. You should end up with a function for each part of the body. See the differ tool and/or Gradescope for examples of complete runs. Restrictions You are not allowed to use any string multiplication on this program. For the torso height and legs, you should try to use while- loops. Also, all of your code should be organized into functions. The only code that may not be in a function is a call to ain You are not allowed to have any global variables. You also should not use the ex function for this PA

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions