Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please only utilize and libraries. Q1. Write a program to print the arrow according to the following requirements. Example 3: Your program should receive two

Please only utilize and libraries.

image text in transcribed
Q1. Write a program to print the "arrow" according to the following requirements. Example 3: Your program should receive two inputs and check the validity of cach input: 'lease input the length (integer): a) An integer length (data type: int), which represents the length of the arrow ("(" or ">" or Do you want to print U/D/L/R?: "" or "+") to be printed. The integer length should be greater than 3; Otherwise, your program should ask the user to input the fengor again util the input is valid. b) A character direction (data type: char), which indicates the direction of the arrow. And the directions of the arrow including 'L', 'R', 'U', 'D', representing "(" or ">" or"(" or "J" respectively. The character direction must be one of these four letters in uppercase or lowercase, i.e., 'L', I', 'R', 'r'. 'U'. u', 'D', 'd'. For the input other than the above letters, Example 4: the program should print "Wrong input!". Please input the length (integer): Notes: 1) We assume the length of each "*" is 1. o you want to print U/D/L/R?: 2) The size of the arrow edge is defined as _ . length , e.g., if length = 7, size(edge)-3; if length-9, size(edge)-4. 3) There is one space between two neighboring "*'s along the horizontal direction. Example 1: lease input the length (integer): Example 5: Please input the length (integer): 'lease input the length (integer): Please input the length (integer): Do you want to print U/D/L/R?: do you want to print U/D/L/R? : drone input! Example 2: 'lease input the length (integer) : lo you want to print U/D/L/RY

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

Students also viewed these Programming questions

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago