Intro to C Programming

1. Write a conditional that assigns true ( 1 ) to the variable fever if the variable temperature is greater than 98.6 .

2.Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000 .

Don't use plagiarized sources. Get Your Custom Essay on
Intro to C Programming
From $10/Page
Order Essay

3 Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the int variables neutral , base , and acid :
0, 0, 1 if pH is less than 7
0, 1, 0 if pH is greater than 7
1, 0, 0 if pH is equal to 7.

4Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18 , adds 1 to the variable adults if age is 18 through 64 , and adds 1 to the variable seniors if age is 65 or older.

5. Given the integer variables x and y , write a fragment of code that assigns the larger of x and y to another integer variable max .

Assume that grade is a variable whose value is a letter grade– any one of the following letters: ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘W’, ‘I’. Assume further that there are the following int variables, declared and already initialized: acount, bcount, ccount, dcount, ecount, fcount, wcount, icount.

Write a switch statement that increments the appropriate variable (acount, bcount, ccount, etc.) depending on the value of grade. So if grade is ‘A’ then acount is incremented; if grade is’B’ then bcount is incremented, and so on.

6. Write a switch statement that tests the value of the char variable response and performs the following actions:
if response is y , the message Your request is being processed is printed
if response is n , the message Thank you anyway for your consideration is printed
if response is h , the message Sorry, no help is currently available is printed
for any other value of response , the message Invalid entry; please try again is printed

7. Write an if/else statement that compares the value of the variables soldYesterday and soldToday , and based upon that comparison, assigns salesTrend the value -1 or 1 .

-1 represents the case where soldYesterday is greater than soldToday ; 1 represents the case where soldYesterday is not greater than soldToday .

Solution Preview
<Ol>
<Li><B>Write a conditional that assigns true ( 1 ) to the variable fever if the variable temperature is greater than 98.6 .</B>

The value of <I>fever</I> is to be changed (to 1) if <I>temperature</I> is greater than 98.6, but otherwise, there should be no change. So a simple if statement can be used:

<I>
if(temperature > 98.6)
fever = 1;
</I>

<Li><B>Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000 .</B>

This is the previous problem itself, with the names changed. Replace true with 10,000, <I>fever</I> with <I>bonus</I>, <I>temperature</I> with <I>goodsSold</I>, and 98.6 with 500,000, and you get the answer:

<I>
if(goodsSold > 500000)
bonus = 10000;
</I>

(Of course, you cannot use commas in the numbers).

<Li><B>Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the int variables neutral , base , and acid :
0, 0, 1 if pH is less than 7
0, 1, 0 if pH is greater than 7
1, 0, 0 if pH is equal to 7.</B>

Here, we need the so called if-else ladder, since there are three cases. The code is very similar to the structure of the problem statement:

<I>
if(pH < 7.0)
{
neutral = 0;
base = 0;
acid = 1;
}
else if(pH > 7.0)
{
neutral = 0;
base = 1;
acid = 0;
}
else
{
neutral = 1;
base = 0;
acid = 0;
}
</I>

Since there are three statements to be executed in each case, we need to enclose these in curly brackets { } (the brackets are optional only …

Solution Summary
The solution discusses the intro to c-programming.To continue with the answer check on mycoursewriter.com/

MyCourseWriter
Order NOW For A 35% Discount!
Pages (550 words)
Approximate price: -

Why Choose Us

Quality Homework Writing

Do you need to ace your test? We have qualified writers to assist you in writing 100% quality homework writing. Mycoursewriter offers students unique and personalized custom papers that help them in getting good grades. Our academic experts will assist you with your dissertation papers, thesis writing, research papers, term papers, and case study homework help. Our writers are experienced and have perfected the art of crafting the best essay writing papers regardless of your academic level. Order now and get our superb homework writing services.

Expert Academic Writers

A student needs professional assistance outside class time. Before hiring our writers, they undergo thorough tests and strict educational backgrounds. After passing a test, our writers undergo training to ensure they deliver expert professional papers to our customers. We ensure they meet the timely delivery of papers and follow our customers' provided instructions. Every writer is an ENL writer and is from the USA, Canada, UK, or Australia. Our experts approach papers effectively depending on their area of specialization.

Affordable Price Guarantees

Is the deal too good to be true? Mycoursewriter is the most affordable assignment help website on the market. We consider students' daily needs for academic help. Our paper costs are reasonably priced to approximately 90% of students around the globe. Our main aim is to ensure students achieve academic excellence, and we believe inconsiderable prices should not hinder students from getting quality homework writing help. In case of any dissatisfaction, we offer unlimited revisions and rewrites without extra charges.

Timely delivery of papers

Tight deadline? Is your paper due in the next few hours? Worry no more. Our writers are here for your rescue. Many college students find it hard to balance their social and academic life and get caught up with academic deadlines. Drafting your paper at the last minute does not allow you to conduct extensive research and craft the correct answers. We have expert writers ready to work on your assignment writing. Urgent writing services are the ultimate solutions you need. We guarantee you timely delivery of papers at your convenience and specified time delivery of the customer.

100% Original Tasks

The ultimate deal-breaker in achieving good grades is submitting imitative papers. Plagiarism is a breach of examination standards and has serious consequences. Students need to deliver papers written in their understanding by paraphrasing their research findings and relevant citations. Our expert's primary consideration is providing free plagiarized papers that meet the lecturers' requirements. Our editors will proofread your paper before delivery ad ensure your papers will not be substandard. We guarantee extreme originality, and in case of any customer concerns, we offer a plagiarism report.

All Round the clock Customer Support

Our website is user-friendly and super useful! Mycoursewriter is the most trusted online writing website always available to provide you with assignment writing services that you need. Our primary concern is meeting customer need specifications by our friendly customer support team that Is available all the time. Our website usability is self-learnable but in case of any problem, feel free to contact us directly through our website email: support@mycourserwiter.com. We have diligently satisfied thousands of students, and you can witness this on our sites' review page.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Advantages of Using Our Assignment writing Services

Mycoursewriter welcomes you for superb essay writing services. We are a legit site offering help with your most challenging homework writing assignments at affordable prices. Your essay paper will be assigned to a professional writer who will craft the paper from scratch according to your provided instructions.

Essays

Essay Writing and Proofreading Services

Essay writing is a common assignment writing for most college students. It takes a lot of time to craft a complete perfect essay. Mycourserwiter offers the best essay writing and proofreading services for most college students. Your paper is assigned to an expert writer who does thorough research on fresh ideas and personalizes your essay paper according to your assignment writing guidelines. Our essays are entirely exceptional and undergo a strict procedure that includes papers free from plagiarism and thorough proofreading.

Admissions

Admission and Business Papers

Writing an admission paper is not every student's desire, and this should not hinder any student from earning an admission. Writing a perfect personal statement to earn a position in a dream school or job can be stressful. Personal statements should display a high level of confidence and uniqueness. Admission essays require you to have a vast knowledge of the current happenings in the world and knowhow of the business world. We have qualified writers with skills who will write your admission paper through comprehensive research. All you have to do is provide us with little details about yourself, instructions and our writers will craft a perfect paper for you.

Editing

Editing and Proofreading

Mycoursewriter offers you assignment writing services free from grammatical and formatting mistakes. An error-free paper is significant in scoring the desired maximum grades. We have a team of editors who will go through your paper after our expert writers have delivered their fully crafted papers. Our writers will cover all the aspects of your paper instructions, such as fonts, spacing, and educational formats. Our team of editors will check through your paper to make sure it meets the formatting style provided in the paper instructions. Under no circumstances will a poorly formatted paper will be forwarded to you as our team of editors will ensure careful proofreading.

Coursework

Technical Papers

Assignment writing is part of a learning process, and one may not have the knowledge to answer all questions correctly. This should not be a stress to you as we have qualified essay writing experts to help you. Our qualified writers are holders of PhDs, Degrees, and Masters in different areas of study and can handle any papers regardless of the complexity. Multiple assignments may be challenging to finish on time. Our skilled professional writers are here to assist you in crafting all the correct answers for your assignment. Stop stressing about your homework writing and place an order with us, and our expert writers will provide you with the best assignment help.