Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

URGENT PLEASE HELP!!!(C Programming) 1. [30 pts] Which of these variable names are valid in C? If they are invalid, explain why. Valid Invalid Reason

URGENT PLEASE HELP!!!(C Programming)image text in transcribed

image text in transcribed

image text in transcribed

1. [30 pts] Which of these variable names are valid in C? If they are invalid, explain why. Valid Invalid Reason number.2 3rd Year Factorial! cestper.ltem cost-per-item 2. [40 pts] Given these statements int x, y double a, b; What are the values of x, y, a, and b after all.of the following code has executed? Pay particular. attention to the data types of the variables for determining integer vs floating point operations. x 13; x- a 10; b-a - (x + y) / 2; [50 pts] Complete the following function by writing C statements that correspond to the description in each comment in the code. 3. #include int main) Il Declare a floating point variable to store a rectangle's width // Declare a floating point variable to store a rectangle's length II Declare a third floating point variable that will store the area of the rectangle. /l Prompt the user to enter a width for the rectangle. /l Get the user's input, and store it in your previously declared variable for width /l Prompt the user to enter a length for the rectangle. /l Get the user's input, and store it in your previously declared variable for length I/ Using an if statement, print out "Error: invalid side length" if either length or width are // less than or equal to 0. ll Else II Calculate the area of the rectangle as a product of length times width, and store the // result in your variable for storing the area // Print "The area of a rectangle with sideswidth> and is " to the screen. II Replace , , and with the value of the associate variables. /I All floating point values should be printed out with 1 decimal place of precision. return 0 [50 pts] Given integer variables minSpeed, maxSpeed, and currentSpeed (which have already been declared and initialized), write if...else statements to print a different string to the screen, based on the relationship between the variables, according to the table below. 4. When current Speed is...Print. "Invalid current speed" "You aren't even moving..." less than 0 equal to 0 greater than O but less than minSpeed_Too slowl Speed up!" greater than maxSpeed between min Speed and maxSpeed "Safe speed achieved. Good job, driver

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Explain the importance of Human Resource Management

Answered: 1 week ago

Question

Discuss the scope of Human Resource Management

Answered: 1 week ago

Question

Discuss the different types of leadership

Answered: 1 week ago

Question

Write a note on Organisation manuals

Answered: 1 week ago

Question

Define Scientific Management

Answered: 1 week ago

Question

Question What is an educational benefit trust and how is it used?

Answered: 1 week ago

Question

Question How are VEBA assets allocated when a plan terminates?

Answered: 1 week ago

Question

Question May a taxpayer roll over money from an IRA to an HSA?

Answered: 1 week ago