Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need helps answering these questions Write a program that reads an integer and prints whether it is negative, zero, or positive. Write a program that

Need helps answering these questions
image text in transcribed
Write a program that reads an integer and prints whether it is negative, zero, or positive. Write a program that reads a floating-point number and prints "zero" if the number is zero. Otherwise, print "positive" or "negative". Add "small" if the absolute value of the number is less than 1, or "large" if it exceeds 1,000,000. Write a program that reads an integer and prints how many digits the number has, by checking whether the number is greaterthanorequalto 10, greaterthanorequalto 100, and so on. (Assume that all integers are less than ten billion.) If the number is negative, first multiply it with -1. Write a program that reads three numbers and prints "all the same" if they are all the same, "all different" if they are all different, and "neither" otherwise. Write a program that reads three numbers and prints "increasing" if they are in increasing order, "decreasing" if they are in decreasing order, and "neither" otherwise. Here, "increasing" means "strictly increasing", with each value larger than its predecessor. The sequence 3 4 4 would not be considered increasing. Repeat Exercise E5.5, but before reading the numbers, ask the user whether increasing/decreasing should be "strict" or "lenient". In lenient mode, the sequence 3 4 4 is increasing and the sequence 4 4 4 is both increasing and decreasing. Write a program that reads in three integers and prints "in order" if they are sorted in ascending or descending order, or "not in order" otherwise. For example, 1 2 5 in order 1 5 2 not in order 5 2 1 in order 1 2 2 in order Write a program that reads four integers and prints "two pairs" if the input consists of two matching pairs (in some order) and "not two pairs" otherwise. For example, 12 2 1 two pairs 1 2 2 3 not two pairs 2 2 2 2 two pairs A compass needle points a given number of degrees away from North, measured clockwise. Write a program that reads the angle and prints out the nearest compass direction; one of N, NE, E, SE, S, SW, W, NW. In the case of a tie, prefer the nearest principal direction (N, E, S, or W). Write a program that reads in the name and salary of an employee. Here the salary will denote an hourly wage, such as $9.25. Then ask how many hours the employee worked in the past week. Be sure to accept fractional hours. Compute the pay. Any overtime work (over 40 hours per week) is paid at 150 percent of the regular wage. Print a paycheck for the employee. In your solution, implement a class Paycheck. Write a program that reads a temperature value and the letter C for Celsius or F for Fahrenheit. Print whether water is liquid, solid, or gaseous at the given temperature a sea level

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_2

Step: 3

blur-text-image_3

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

What are the advantages and disadvantages of BYOD?

Answered: 1 week ago