Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coding Exercise: Tasty Typecasting Write a program to help you feed your friends at a party by doing some math about square pizzas . Assume

Coding Exercise: Tasty Typecasting

Write a program to help you feed your friends at a party by doing some math about square pizzas. Assume the grader defines a string inputStr for you, which is a decimal string meaning the side length L of the pizza in cm. The area of the pizza should be computed using the formula A = L*L. Then, assuming that each person needs to eat 100 cm2 of pizza, compute the number of people it can feed, rounded down to the nearest integer. Hint

Example: if inputStr is "17.5", the area will be 306.25 cm2, so 3 is the correct output.

Coding Exercise: What's Your Sign?

Write a program that reads an integer from input, then outputs one of the capitalized words Positive, Negative, or Zero according to whether the number is positive, negative, or zero.

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 Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

=+The long-run aggregate supply curve?

Answered: 1 week ago