Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help getting the code for this. i have attached a photo of what the output of the code is. In season 7, episode

i need help getting the code for this. i have attached a photo of what the output of the code is.
image text in transcribed
image text in transcribed
In season 7, episode 24 of Seinfeld, Kramer visits a bank that promises to give $100 to anyone who isn't greeted with a "hello." Kramer is instead greeted with a "hey," which he insists isn't a "hello," and so he asks for $100. The bank's manager proposes a compromise: "You got a greeting that starts with an 'h,' how does $20 sound?" Kramer accepts. Implement a program that prompts the user for a greeting. If the greeting starts with "hello", output $0. If the greeting starts with an " h " (but not "hello"), output $20. Otherwise, output $100. Ignore any leading whitespace in the user's greeting, and treat the user's greeting case-insensitively. Hint Be sure to give $0 not only for "hello" but also "hello there", "hello, Newman", and the like. Use ' q ' or 'Q' to quit say a greeting: (Q|q to quit): Hello INF02000 you get $0 say a greeting: (Q/q to quit): hi You get $20 say a greeting: (Q|q to quit): h You get $20 say a greeting: (Q/q to quit): say less You get $100 say a greeting: (Q/q to quit): plead the 5 th You get $100 say a greeting: (Q/q to quit): You get $100 say a greeting: (Q/q to quit): q Bye

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions