Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help with question 6&7 with given information c language No submissions will be Make sure to add a header comment at the beginning with

please help with question 6&7 with given information
image text in transcribed
c language
No submissions will be Make sure to add a header comment at the beginning with the he the program. Each variable declaration should have a comment explaining the variable's purpose. Write a program with the following declarations: using declarations to reserve space for datae An integer named count with initial value 10 int Count = 10; A decimal variable name resistor1 with initial value 22.5 float resistar1 = 22.5; A character variable name chi with initial value 'p' char chl= P ; ? Add code to display each of the variables on its own line. Include the variable's name and its value. Now add declarations for the following variables but do not initialize them. Integers ox ancy int cx=cy : Floating point numbers 11,12 , watts , and hp.+ floato f1.42.2 Watts = hp : And double variable di double di Include code to ask the user for values to place into each of the variables. Then echo to the display the 7 variables on their own line. Include the variable's name and its value. int cx, ayi float f, f2, watts, he b= 22.5) Use a preprocessor directive to create a constant named HPZWATTS equal to the value 746 Daski #include HP2WATTS = 7463 the user to enter the horsepower, place their response in hp. Using the constant HP2WATTS calculate the number of watts for the given horsepower (place the answer in watts) and then display the number of watts for that horse power to the screen. Repeat the previous step (add new code), except this time create a macro name convertHP that will perform the conversion (multiplies HP2WATTS times the macro's parameter). Display the number of watts for the horse power calculated with the macro X>10) Note: #Watts = (746 Walt) #hp) ( hp Please help With Questions bt

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago