Question about c programming

Assignment Help Software Engineering
Reference no: EM1378977

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

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

Question3 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.

Question4Write 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.

Question5. 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 account is incremented; if grade is'B' then bcount is incremented, and so on.

Question6. 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

Question7. Write an if/else statement that compares the value of the variables sold Yesterday and sold Today , and based upon that comparison, assigns sales Trend the value -1 or 1 .

-1 represents the case where sold Yesterday is greater than sold Today ; 1 represents the case where sold Yesterday is not greater than sold Today .

 

Reference no: EM1378977

Questions Cloud

Writing and executing an insert statement : Make yourself a student by writing and executing an INSERT statement to insert a row into the STUDENT table with information about you.
Finding example of source code : Discover one example of each label in the following source code and write the line number of the example next to the label.
Process of formal software testing : Discuss and explain software testing as a career path, and consider what skills would be desirable for a software tester.
Develop a disease surveillance algorithm for hiv : Write a 2 page paper in which you analyze the cost, functionality, timeframe, and social, political, environmental, and economic elements of your designed HIV/AIDS disease surveillance system.
Question about c programming : Construct a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000.
Solving linear equations and linear inequalities : Discuss briefly and explain software testing as a career path, what skills would be desirable for a software tester.
Question about newspaper popularity : Many people lament the fact that the printed newspaper's popularity is refusing so alarmingly that some of children of the new generations have never read a printed newspaper.
Determine the balance in the finished goods inventory : Determine the balance in the Finished Goods Inventory and compute the cost of goods manufactured for November
Functional specifications for the software : When looking at a need for a change or improvement in a current system, what are two of the most important processes to examine and explain your answer.

Reviews

Write a Review

Software Engineering Questions & Answers

  Create a weather object using the no-argument constructor

Create a 'Weather' object using the no-argument constructor

  Information flow complexity

Cyclomatic complexity, monitoring devices, wireless dial-out device with controller, Request for Proposals (RFPs), Weighted IFC

  Create high-level e-r diagram for hospital

Your first assignment is to work as part of the team of three persons to create high-level E-R diagram for hospital. You conduct interviews with number of hospital administrators and staff to recognize key entities.

  Create object relationship diagram gives overview of system

Create an object relationship diagram that provides an overview of the system, including how textbooks are selected by instructors, approved by a department head, and sold to students by the bookstore.

  Design pseudocode and flowchart for swallowing a pill

Write a solution in pseudocode for swallowing a pill. Translate solution into flowchart. Write about which tool they like best and why? Which tool do they think would be easiest to learn?

  Create inheritance hierarchy for customer-s bank account

Create inheritance hierarchy which a bank might use to represent customer's bank accounts. All customers at this bank can deposit money into their accounts and withdraw money from accounts.

  Create uml collaboration diagrams using microsoft visio

Create UML collaboration diagrams using Microsoft Visio or another drawing tool capable of preparing properly formatted UML collaboration diagrams.

  How could core erp components aid improve business operation

How could core ERP components aid improve business operations at college? How could extended ERP components aid improve business operations at the college.

  Sketch environment diagram illustrating structure of pizza

Assume we evaluate following expressions: (define pizza (make-thing 'pizza robot-lab)) (ask pizza 'set-owner holly). Sketch environment diagram, illustrating full structure of pizza at point where this expression is evaluated.

  Risk management in tellers in four-digit numeric password

Tellers at each branch use a four-digit numeric password, and each teller's computer is transaction-coded to accept only its authorized transactions. Carry out a risk assessment.

  Defining competitive advantage of a business

Discuss the key concepts related to defining competitive advantage of a business? Choose one and describe how you would use information systems to aid in obtaining competitive advantage with your selected key idea.

  Create logic for program that will produce count of readers

Create the logic for a program that would produce a count of readers by income groups as follows: under $20,000, $20,000- $29,999, $30,000-$49,999, $50,000-$69,999, and $70,000 and up.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd