Free Essay

C++ Case Statements

In:

Submitted By acintronpr
Words 908
Pages 4
CMIS102 Homework Assignment 2 (Worth 13% of your grade)

Student Name: Ariel Cintron

Class/Section: CMIS102 / 6383

Professor Name: Ronald Mcfarland

Assignment due date: Feb 01 2012

Problem definition: Calculate the total price to purchase all the components required to build a state-of-the-art gaming computer from components available on the internet.

A. Problem Analysis – Following the directions in the assignment, clearly write up your problem analysis in this section.

The input consists of computer base price (CompPrice), the CPU choice (CPU_choice), the RAM choice (RAM_choice), and the Graphics Card choice (VideoCard_choice). Once the customer has entered a choice of an option, the program will determine the corresponding cost of that option: CPU_cost, RAM_cost, VideoCard_cost.

The only item output is the computer selling price (ComputerPrice). To determine the ComputerPrice, the following computation is: ComputerPrice = CompPrice + CPU_cost + RAM_cost + VideoCard_cost.

B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode.

Things the program must do:

1. Input the computer base price

2. Process the various options to compute the additional costs

3. Total all the costs

4. Display the final selling price

The main Module will contain the following submodules:

Compute_CPU_Cost

Compute_RAM_Cost

Compute_VideoCard_Cost

Display_Computer_Price

The Hierarchy chart for Computer Price program

Pseudocode as follows:

// Computer Price calculator
// Programmer: Ariel Cintron, University Of Maryland University College
// Version 1.0 – February 03, 2012
// This program calculate the total price to purchase all the components required to build a
// state-of-the-art gaming computer from components available on the internet.
// Variables used:
// CompPrice – computer base price
// CPU_choice, RAM_choice, VideoCard_choice – CPU, RAM and Video card options choices
// CPU_cost, RAM_cost, VideoCard_cost – CPU, RAM and the Video card cost once the options // are selected
// ComputerPrice – calculated the toal price of the computer.

//*************************************************************************

Main module

// Declare the variables
Declare CompPrice, CPU_cost, RAM_cost, VideoCard_cost As Float

// Display welcome message and program menu choices
Write “ Welcome to Computer Gaming Build”
Write “ This program is designed to calculate the total price of a”
Write “ computer gaming system.”

// Prompt for and input the computer base price:
Write “Enter the Computer base price”

// Computer base price input
Input CompPrice

// Call Modules
Call Compute_CPU_Cost
Call Compute_RAM_Cost
Call Compute_VideoCard_Cost
Call Display_Computer_Price
End Program
//***********************************************************

Compute_CPU_Cost module
//Declare variables
Declare CPU_choice As Character

// Display the menu and input user selection:
Write “i950 – Intel Core i7-950 Bloomfield 3.06GHz LGA 1366 130 Quad-Core Processor”
Write “i2600k – Intel Core i7-2600K Sandy Bridge 3.4GHz (3.8GHz Turbo Boost) LGA 1155”
Write “95W Quad-Core Desktop Processor Intel HD Graphics 3000”
Write “i980 – Intel Core i7-980 Gulftown 3.33GHz LGA 1366 130W Six-Core Processor”
Write “Please enter your selection”

// CPU selection input
Input CPU_choice

// Price options are as follows:
Select Case of CPU_choice Case “i950”: Set CPU_cost = 269.99 Case “i2600k”: Set CPU_cost = 329.99 Case “i980”: Set CPU_cost = 589.99
End Case

//**************************************************************

Compute_RAM_Cost module
// Declare variables
Declare RAM_choice As Character

// Display the menu and input user selection:
Write “TX8 – Team Xtreem LV 8GB (2 x 4GB) 240-Pin DDR3 2400 (PC311900)”
Write “EVO – GelL EVO CORSA Series 16GB (4 x 4GB) 240-Pin DDR3 2400 CL 10”
Write “GSK – G.SKILL Ripjaws Z 16GB (4 x 4GB) 240-Pin DDR3 2400 CL 9”
Write “Please enter your selection”

// RAM selection input
Input RAM_choice

// Price options are as follows:
Select Case of RAM_choice Case “TX8”: Set RAM_cost = 149.99 Case “EVO”: Set RAM_cost = 349.99 Case “GSK”: Set RAM_cost = 629.99
End Case

//*******************************************************************

Compute_VideoCard_Cost module
// Declare variable
Declare VideoCard_choice

// Display the menu and input user selection:
Write “V5900 – ATI FirePro V5900 2GB 256-bit 512 Support Stream PCI Express 2.1x16”
Write “V7900 – ATI FirePro V7900 2GB 256-bit 1280 Support Stream PCI Express 2.1x16”
Write “Please enter your selection”

//Video Card selection
Input VideoCard_choice

// Price options are as follows:
If VideoCard_choice = “V5900” Then Set VideoCard_choice = 429.99
Else
Set VideoCard_choice = 699.99
End If

//**********************************************************************

Display_Computer_Price module
// Declare variables
Declare ComputerPrice As Float

// Total Computer price
Set ComputerPrice = CompPrice + CPU_cost + RAM_cost + VideoCard_cost

//Output on Display of total price base on selection
Write “Computer Base Price” + CompPrice
Write “CPU” + CPU_choice + “Price” + CPU_cost
Write “RAM”+ RAM_choice + “Price” + RAM_cost
Write “Video Card” + VideoCard_choice “Price” + VideoCard_cost
Write “The total computer cost base on your selection is: $” + ComputerPrice

C. Program Comments and Test Data – Following the directions in the assignment, include your test data and expected results in this section.

Concept of the program how should run.

// Computer Base Price

CompPrice = 1815.94

// User select CPU, RAM and Video card choice

CPU_choice = “i950” // selected choice of three options

RAM_choice= “TX8” // selected choice of three options

VideoCard_choice = “V5900” // selected choice of two options

//Base on user option selection from menu the compute formula goes as follows:

CPU_cost = 269.99

RAM_cost = 149.99

VideoCard_cost = 429.99

ComputerPrice = CompPrice + CPU_cost + RAM_cost + VideoCard_cost

ComputerPrice = 1815.94 + 269.99 + 149.99 + 429.99

ComputerPrice = 2665.91

Table 1. Include your test data table here

|Input: Computer Base Price, CPU, RAM, Video Card |Output : Total Computer Price |
| |ComputerPrice = CompPrice + CPU_cost + RAM_cost + |
| |VideoCard_cost |
|Computer Base Price | |
|CPU | |
|Option | |
|RAM |Total Computer Price : $2665.91 |
|Option | |
|Video Card |Total Computer Price: $3735.91 |
|Option | |
| |Total Computer Price: $3133.90 |
|1815.94 | |
|i950 = 269.99 | |
|TX8 = 149.99 | |
|V5900 = 429.99 | |
| | |
|1815.94 | |
|i980 = 589.99 | |
|GSK = 629.99 | |
|V7900 = 699.99 | |
| | |
|1763.93 | |
|i980 = 589.99 | |
|EVO = 349.99 | |
|V5900 = 429.99 | |
| | |
| | |
| | |
| | |
| | |
| | |

-----------------------
Main Module

Compute
Video Card Cost

Compute
RAM Cost

Compute
CPU Cost

Display
Computer Price

Similar Documents

Free Essay

Life

...If statement [pic] 1. void main()   2. {   3. int a=5,b=6,c;   4. c = a + b ;   5. if (c==11)   6. printf("Execute me 1");   7. printf("Execute me 2");   8. }   9. Output : 10. Execute me 1 ////////////////////////////////////////////////////////////// Else-if Ladder in C : Decision Making [pic] 11:11 AM [pic] Admin [pic] 1 comment If Else Ladder / Else-If Clause Syntax of Else-If Ladder :  view plainprint? 1. #include   2. if(expression1)   3.  statement1;   4. else if(expression2)   5.  statement2;   6. else if(expression3)   7.  statement3;   8. else   9.  statement4;   [pic] Explanation :  • Conditions are evaluated from Top to Bottom • As soon as TRUE expression is found the statement associated with it is executed and rest of the ladder isBypassed Flowchart :  [pic] Sample Example : To find the Grade of the Student) view plainprint? 1. if (marks >= 67 )   2. printf("Distinction");   3. else if (marks >=60)   4. printf("First Class");   5. else if (marks >=55)   6. printf("Higher Second Class");   7. else if (marks >=50)   8. printf("Second Class");   9. else if (marks >=40)   10. printf("Pass Class");   11. else   12. printf("Fail");   ///////////////////////////////////////////////////////////////// If – else statement [pic] 1. void main()   2. {   3. int marks=50;   ...

Words: 1725 - Pages: 7

Free Essay

Nothing

...Basic If Statement Syntax The structure of an if statement is as follows: ------------------------------------------------- if ( TRUE ) ------------------------------------------------- Execute the next statement ------------------------------------------------- if ( TRUE ) { ------------------------------------------------- Execute all statements inside the braces ------------------------------------------------- } Syntax: The syntax of an if...else statement in C++ is: ------------------------------------------------- if(boolean_expression) ------------------------------------------------- { ------------------------------------------------- // statement(s) will execute if the boolean expression is true ------------------------------------------------- } ------------------------------------------------- else ------------------------------------------------- { ------------------------------------------------- // statement(s) will execute if the boolean expression is false ------------------------------------------------- } ------------------------------------------------- ------------------------------------------------- #include <iostream> ------------------------------------------------- using namespace std; ------------------------------------------------- ------------------------------------------------- int main () ------------------------------------------------- { ------------------------------------------------- ...

Words: 1596 - Pages: 7

Premium Essay

Exercises

...crew? (b) How many ways are there to pair off eight women at the dance with eight of these 12 men? 8. In how many ways can the letters in WONDERING be arranged with exactly two consecutive vowels? • Ch. 2 of Discrete and Combinatorial Mathematics o Exercise 2.1, problems 2 o Exercise 2.2, problems 3 o Exercise 2.4, problems 1 o Exercise 2.5, problems 1 2. Identify the primitive statements in Exercise 1 below: Exercise 1. Determine whether each of the following sentences is a statement. a) In 2003 GeorgeW. Bush was the president of the United States. b) x + 3 is a positive integer. c) Fifteen is an even number. d) If Jennifer is late for the party, then her cousin Zachary will be quite angry. e) What time is it? f ) As of June 30, 2003, Christine Marie Evert had won the French Open a record seven times. 3. Use the substitution rules to verify that each of the following is a tautology. (Here p, q, and r are primitive statements.) a) [p ∨ (q ∧ r)] ∨ ¬[p ∨ (q ∧ r)] b) [(p ∨ q)→r] ↔ [¬r →¬(p ∨ q)] 1. Let p(x), q(x) denote the following open statements. p(x): x ≤ 3 q(x):...

Words: 1279 - Pages: 6

Premium Essay

Acc 565 Week 5 Midterm Exam

...have almost the same legislative weight as the IRC. 5) A revenue ruling is issued by the Internal Revenue Service only in response to a verbal inquiry by a taxpayer. 6) Taxpayers must pay the disputed tax prior to filing a case with the Tax Court. 7) Appeals from the U.S. Tax Court are to the Court of Appeals for the Federal Circuit. 8) Appeals from the Court of Appeals go to the Supreme Court under a writ of certiorari. The Supreme Court decides whether or not they will hear the case. 9) A citator enables tax researchers to locate authorities (e.g., cases and IRS pronouncements) that have cited a particular case. 10) According to the Statements on Standards for Tax Services, CPAs must verify all tax return information submitted by reviewing client documentation. 11) When a taxpayer contacts a tax advisor requesting advice as to the most advantageous way to dispose of a stock, the tax advisor is faced with A) a restricted-fact situation. B) a closed-fact situation. C) an open-fact situation. D) a recognized-fact situation. 12) Investigation of a tax problem that involves a closed-fact situation means that A) the client’s transactions have already occurred and the tax questions must now be resolved. B) the client’s tax return has yet to be filed. C) future events may be planned and controlled. D) research...

Words: 4931 - Pages: 20

Premium Essay

Nothing

...2015 __C_1. A case structure is a ___________ decision structure. a. single-alternative b. dual-alternative c. multiple-alternative d. triple-alternative B___ 2. What is the expected output of the following flowchart? a. My age is 31 and your age is less than that b. Our ages do not qualify c. Nothing d. Syntax error _A__ 3. What is the expected output of the following flowchart? a. My age is between 32 and 35 b. My age is not within that range c. Nothing d. Syntax error __D_ 4. Which structure causes a statement or set of statements to execute repeatedly? a. Start Over b. Sequence c. Decision d. Repetition _B__ 5. What type of loop uses a Boolean expression to control the number of times that it repeats a statement or set of statements? a. Count-controlled b. Condition-controlled c. Infinite d. User-controlled _A__ 6. Which pair of loops causes a statement or set of statements to repeat as long as a condition is true? a. While and Do-While b. While and Do-Until c. Do-While and Do-Until d. Do-While and For _A__ 7. ___________ represents a special value that marks the end of a list of values. a. Sentinel b. Stop c. End d. Start _C__ 8. Which loop is specifically designed to initialize, test, and increment a counter variable? a. Do-While b. Do-Until c. For d. While _D__9. How many times will the following loop iterate? Set k = 1 While k < = 5 Display k End While a. Three b. Two c. Five d. Infinite ...

Words: 789 - Pages: 4

Premium Essay

Accounting 101 Quiz

... BASIS FINANCIAL STATEMENTS Chapter Summary Financial statements are the primary means of communicating financial information to users. Chapter 2 covers the income statement, balance sheet, and statement of cash flows. Chapter 1 set forth the objectives of the financial reporting process, and offered the observation that these objectives are met in large part by a set of financial statements. In this chapter, we take up the task of introducing the balance sheet, income statement, and the statement of cash flows. The presentation is organized around the accounting equation. The equation serves as the basis for elementary transaction analysis. A continuing illustration examines the impact of a number of simple transactions upon the balance sheet of a simple service business. Revenue and expense transactions have been included so that we might introduce the income statement and statement of cash flows at an elementary level. This in turn has provided the opportunity to discuss and illustrate statement articulation. Before closing, the chapter emphasizes the importance of adequate disclosure regarding both financial and nonfinancial information, thereby reinforcing the Chapter 1 theme that the financial reporting process is broader than the financial statements. The chapter also covers accounting principles dealing with asset valuation...

Words: 3069 - Pages: 13

Free Essay

Cat Mock 2

...1. b There are two clues to solve this question. The first is the mandatory pair (A-B). Statement B has to come immediately after statement A as B is the response of the Labour party to the “row about the legitimacy….” mentioned in A. This leaves us with options (b) and (d). Here the difference is in the order of statements D & E. (D-E) would be the correct order as statement D introduces the event while statement E begins the description of the events that followed. Statement E also matches the tone of statement C. The paragraph has a mandatory pair (D-B) as B carries further the idea of opening of the cages, which gets introduced in D. (C-A) is another mandatory pair. Statement C compares India’s performance on social indicators with that of Asian economies. Statement A further compares India’s performance with that of poor African countries. Only options (c) and (d) have both mandatory pairs. Option (d) gets negated as the paragraph must start with C, which introduces the para. Option (c) aligns all the statements of the paragraph thereby making it coherent. Statement C clearly emerges as an introductory sentence “an episode regarding the….”. (A-E) is a mandatory pair as in statement E Akbar gives reasons to refute Hakim Ali’s argument. The only possible answer choice is (b). 6. c Option (a) clearly refers to the opening of the story which is gruesome yet comical. Option (b) is correct as the author creats humour inspite of Brr not knowing language for very long. Refer...

Words: 5168 - Pages: 21

Premium Essay

Exam Marktcontext

...strategic behavior (chapter 11)? a) preventing resales b) advantage c) commitment d) both answers b and c are correct 2. Which of the following condition(s) does a governmental institution aim for in correcting market inefficiencies? (chapter 20) a) Correcting deviations from perfect competition in b) redistribution of incomes c) stimulating the appliance of the following productionrule MO = MK (marginal revenue = marginal cost) d) both answer a. and b. are correct 3. In the long-term companies in monopolistic competition make (chapter 7) a) Small positive economic profit b) large positive economic profit c) no economic profit d) none of the above 4. In Chapter 12 concerning vertical integration and vertical restrictions several reasons are discussed that justify vertical integration. Which of the following answers is NOT a reason for vertical integration? a) Internalizing externalities b) lowering transaction costs c) avoiding governmental regulation d) assuring demand for goods 5. A dominant firm is defined as a firm that (chapter 4) a) Has a large marketshare b) is a price setter and is confronted with small companies that are price takers c) creates a new technological standard in the market d) has market power 6. (With reference to chapter 3) Consider the following two statements about the horizontal portion of the short-run market supply in perfect competition: ...

Words: 2139 - Pages: 9

Free Essay

Evidence Outline

...OUTLINE Prof. Mark Bonner Fall 2012 |1 • INTRODUCTION | I. Trial Context A. types of evidence at trial 1. witnesses 2. real evidence – something tangible related to the case 3. demonstrative evidence – not part of the story, but lawyer wishes to show the jury something to demonstrate something about the case (e.g., experiment; picture of intersection) B. competing stories at trial – two ways stories can compete 1. factual differences 2. differences in inferences drawn from the same facts II. Policy Overview [values that the evidence rules protect] A. accuracy 1. rationality – does evidence have a rational relationship to the case? 2. reliability – is the evidence credible? B. efficiency – see FRE 403 C. fairness – rules should be party-neutral 1. but note: some rules exclude evidence to one party’s advantage (e.g., evidence that Δ fixed the steps after the accident excluded, b/c we want to encourage Δs to make steps safer) (e.g., Confrontation Clause, guarantees rt of accused in a criminal trial to confront witnesses brought against him) D. danger of misuse of information 1. one solution: limiting instructions 2. but sometimes we’re so skeptical of jury’s willingness/ability to follow...

Words: 30878 - Pages: 124

Free Essay

Pt1420 Final Exam

...structure. case structure is a a. Single-alternative b. Dual-alternative d. Triple-alternative What is the expected output of the following flowchart? elrH?Xe*$le#s# ,,&.k$ry]ffilit*i+ My age is 31 and your age is less than that b. Our ages do not qualify c. Nothing d. Syntax error a. { FINAL EXAM STUDY GUIDE 3. What is the expected output of the following flowchart? My age is between 32 and 35 b. My age is not within that range c. Nothing a. d. Syntax error FINAL EXAM STUDY GUIDE 4. What is the expected output of the f'ollowing flowehart? You canvoto You carurot vote Nolhing d. Syntax error a. b. c. FINAL EXAM STUDY GUIDE 5. What is the expected output of the following flowchart? a. One of our numbers is 83 b. 83 is not our numbers c. Nothing d. Syntax error 6. Which operator would make the following expression true? False_Jrue a. b. AND NOT ffi d. OTHER 7. Which operator would make the following expression false? False True b. NOT d. OTHER c. OR 4 FINAL EXAM STUDY GUIDE 8. If the expression is false, the a. AND operator will return true. ffiOR c. d. 9. OTHER What type of operators are the following? d. 10. The Mathematical first line of the case structure starts with the word CASE followed by the test expression. a. True I l. Which a. b. c. structure causes a statement or set of statements to execute repeatedly...

Words: 761 - Pages: 4

Premium Essay

Managerial Ethics

...false b) i,,iv are true and ii is false c) i,ii are true and iii,iv are false d) ii,iii,iv are true and i is false Question 2 : Test planning has which of the following major tasks? i. Determining the scope and risks, and identifying the objectives of testing. ii. Determining the test approach (techniques, test items, coverage, identifying and interfacing the teams involved in testing , testware) iii. Reviewing the Test Basis (such as requirements, architecture, design, interface) iv. Determining the exit criteria. a) i,ii,iv are true and iii is false b) i,,iv are true and ii is false c) i,ii are true and iii,iv are false d) ii,iii,iv are true and i is false Question 3 : Evaluating testability of the requirements and system are a part of which phase:- a) Test Analysis and Design b) Test Planning and control c) Test Implementation and execution d) Evaluating exit criteria and reporting Question 4 : One of the fields on a form contains a text box which accepts alphabets in lower or upper case. Indentify the invalid Equivalance class value. a. CLASS b. cLASS c. CLass d. CLa01ss Question 5 : In a system designed to work out the tax to be paid: An employee has £4000 of salary tax free. The next £1500 is taxed at 10% The next £28000 is taxed at 22% Any further amount is taxed at 40% Which of these groups of numbers would fall into the same equivalence class? a) £4800; £14000; £28000 b) £5200; £5500; £28000 c) £28001; £32000; £35000 d) £5800; £28000;...

Words: 2314 - Pages: 10

Premium Essay

How to Write a Case Report

...CHAPTER 9 ON Writing about a case builds on the process of analyzing a case.The case situations described in previous chapters can be used to organize essays. An essay arguing a decision is organized in a different way from one offering a problem diagnosis.The structure of problem, decision, and evaluation essays is described in chapters 10 through 12, respectively. The chapters also include cases and sample essays about them. The essays are based on the writing of MBA students. To convince a reader that a conclusion about a case is valid, the writer must offer credible evidence linked directly to the conclusion. This fact helps explain the characteristics case-based essays have in common: 1. Answers two questions—What? Why?—and often a third—How? 2. Makes a position statement (What?) OT C CHAR ACTERISTICS OF A PERSUA SIVE C A SE ESSAY OP riting about a case is very different from talking about it.You collaborate with others in a discussion, bringing to bear everyone’s background and case preparation along with the instructor’s knowledge and facilitation skills. But you usually work on your own when writing about a case.You have to perform the entire analysis yourself as well as organize and express your thinking for a reader. However, the difference between talking and writing about a case runs deeper still.Audiences have much more exacting expectations of a text than they do of spoken comments. Logical gaps and the back-and-fill tolerable in a discussion are...

Words: 4663 - Pages: 19

Free Essay

Cis 517 Wk 6 Case Study 2

...CIS 517 WK 6 CASE STUDY 2 To purchase this visit here: http://www.activitymode.com/product/cis-517-wk-6-case-study-2/ Contact us at: SUPPORT@ACTIVITYMODE.COM CIS 517 WK 6 CASE STUDY 2 CIS 517 WK 6 Case Study 2 - Green Computing Research Project – Part 2 Read the Green Computing Research Project, Part 2 in Appendix C. Document the requirements and develop a scope statement. Write a two to three (2-3) page paper in which you: 1. Document the requirements based on the information provided and assumptions that you have made, including a requirements traceability matrix. 2. Include a list of questions to ask the sponsor about the project scope. Include at least six (6) questions for full credit. 3. Develop a scope statement for the project. More Details Included... Activity mode aims to provide quality study notes and tutorials to the students of CIS 517 WK 6 Case Study 2 in order to ace their studies. CIS 517 WK 6 CASE STUDY 2 To purchase this visit here: http://www.activitymode.com/product/cis-517-wk-6-case-study-2/ Contact us at: SUPPORT@ACTIVITYMODE.COM CIS 517 WK 6 CASE STUDY 2 CIS 517 WK 6 Case Study 2 - Green Computing Research Project – Part 2 Read the Green Computing Research Project, Part 2 in Appendix C. Document the requirements and develop a scope statement. Write a two to three (2-3) page paper in which you: 1. Document the requirements based on the information provided and assumptions that you have made, including a requirements traceability...

Words: 649 - Pages: 3

Premium Essay

Cases in Financial Management

...CASES IN FINANCIAL MANAGEMENT SYLLABUS FIN 522 Professor James A. Gentry Cases In Financial Management 343M Wohlers Hall Spring Semester 2009 333-7995 2043 BIF j-gentry@uiuc.edu Office Hours: 10:30 a.m. to 11:45 a.m. on Mon. and Wed/. or by Appointment I. Teaching Objectives Financial decision making cases are used to… • Create a highly interactive learning environment; • Learn about the application of financial management and credit analysis concepts; • Discover what you do not know about the practice of financial management; • Show what you have learned; • Highlight the relationships between strategic goals and the creation of firm value; • Develop techniques for interpreting a firm’s financial data and strategic plans; • Enhance your critical thinking and problem solving skills; • Expand your understanding of financial theory and its application; • Improve your listening and cooperative learning skills. II. Learning Promises At the end of this course your will be able to… • Think like a financial manager; • Interpret a company’s financial health by evaluating the performance...

Words: 5389 - Pages: 22

Free Essay

Book Report

...Selection statements Selection is used to select which statements are to be performed next based on a condition being true or false. Relational expressions In the solution of many problems, different actions must be taken depending on the value of the data. The if statement in C I used to implement such s decision structure in its simplest form – that of selecting a statement to be executed only if a condition is satisfied. Syntax: if(condtion) statement executed if condition is true When an executing program encounters the if statement, the condition is evaluated to determine its numerical value, which is then interpreted as either true or false. If the condition evaluates to any non-0 value (positive or negative), the condition is considered as a “true” condition and the statement following the if is executed; otherwise this statement is not executed. Relational Operators In C Relational operator | Meaning | Example | < | Less than | age < 30 | > | Greater than | height > 6.2 | <= | Less than or equal to | taxable <= 200000 | >= | Greater than or equal to | temp >= 98.6 | == | Equal to | grade == 100 | != | Not equal to | number !=250 | In creating relational expressions, the relational operators must be typed exactly as given in the above table. Thus, although the following relational expressions are all valid: age > 40 length <= 50 temp >= 98.6 3 < 4 flag == done day != 5 The following are invalid: length =< 50 ...

Words: 1617 - Pages: 7