New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Computer Science I

by: Joshuah McLaughlin

Computer Science I CSCE 1030

Joshuah McLaughlin
GPA 3.7

Philip Sweany

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Philip Sweany
Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 11 page Class Notes was uploaded by Joshuah McLaughlin on Sunday October 25, 2015. The Class Notes belongs to CSCE 1030 at University of North Texas taught by Philip Sweany in Fall. Since its upload, it has received 198 views. For similar materials see /class/229103/csce-1030-university-of-north-texas in ComputerScienence at University of North Texas.

Similar to CSCE 1030 at UNT


Reviews for Computer Science I


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/25/15
Review For 1030 EXAM ONE 2222011 55500 PM The following is a list of major test topics that will be on our first exam scheduled for Thursday February 24th 2011 Be sure to read through all of the notes that we covered and be familiar with the information covered in those notes The test format will be shortanswer requiring you to write definitions interpret code indicate what it does and actually write source code on the exam to answer a series of questions related to the topics below Common programming terminology syntax semantics source program algorithm casesensitive mutualexclusion answer Syntax Source Program an original computer program written by a programmer that is converted into the equivalent object program written in machine language by the compiler or assemble SyntaxThe Grammatical rules related to programing C Variable expr op Semantics The meaning of the statement in a program Result A B Subtract the value of a variable B from variable A and assign the difference to the variable result Algorithm logical steps to solve a problem Casesensitivelowercase letters and capital letters are considered to be different mutual exclusionis when you have two things Which one can you pick One and only one Switch statements General format of a C program multiline comments are surrounded by 39 and l C Program Example course CS 1030 c Programming programmer Don Retzlaff don8untedu C program to accept two numbars from use and add the numbers together singleline comments begin with H iuclude ltstdiohgt H include system information every C program has a main block procedure this indicates where the program begins execution variables are display initial program idlntification defined at the printf quotSimple C Program A Dan Retzlaft doanuntedunnquot int main 1 int numl 111112 sum bagmmng If prompt the use for input the mam prim5 quotPlease enter first umber quot 1 Procedure scanf tquotdquotampnuml printf quotPlease into second number quotJ scan quotdquotampnm2 a scarf is used to get input the curll sum numl num2 braces print quotThe sum is dnquotsum1 39 l aluesfrom the user denote the beginning and ending of a block of code in a C program every statement ends in a semicolon similar to a sentence in English return panyquot is used to output information to the screen the main procedure of every C Program Should quot9mm 0 value the assignment operator is used to assign values to variables such as mathematical expressions Format of C Comments and Multiline One line C Statement separator symbol Commands are separated by semicolons C Data Types int oat double char string Integer whole numbers only Float oating point decimal numbers numbers always written with a decimal point Doubledoubleprecision oating point for more accurate numbers Char A single character Character constants are single characters surrounded by singlequotes l Examples of character constants 39A39 39a39 39039 3939 Special character constants actually written with two characters the first being a backslash 3 39n39 newline go to beginning of next line in the output t39 tab increase space between items 39quot39 double quote 39quot single quote 39 backslash StringA string is a sequence of characters followed by a special terminating character called anull the terminating null character is assumed when a string is specified with doublequotes 1 quotNone or more charactersquot quotThis is a messagenquot quotThisthasttabsquot quotAquot Syntax for declaring C data typesanswer Int x int yz C Math operators their meaning and useanswer gives you the whole portion in dividing known as a modulo gives you remainder of integers add Subtract Multiply C Math operator precedence rulesanswer 0 Multiply divide modulo Changing the math operator precedence rulesanswer When two or more operators are used in the same mathematical expression operator precedence rules take effect Operator Precedence defines which operators take precedence are performed first C s operator precedence rules are straightforward and match what we have commonly learned in mathematics processed left to right processed left to right Precedence rules can be altered by surrounding operations in parentheses Here are some additional examples of C mathematical expressions using Math Operators Numeric Constants and Variables num1 num2 a b c a b c 10 Total 512 13 Num 10 C Assignment statementsanswer printf output function syntax and basic formatting code rulesanswer Examples of printf printf hello theren printf value is 10dn num printf Another one is 102 n interest Formatting codes dintegers ffloats lflong float cCharacter sStrings Scanf examples scanf input function syntax and basic formatting code rules use of Scanf d ampvaue ampersand amp before variable referencesanswer ifelse statementsanswer if statement logical operators ltgtlt gt ampamp answer lt lesser than gt Greater than lt Lesser than or equal too gt Greater tan or equal too Equal too Not equal too Equality ampamp and to ampersands H or two vertical bars not in the gates Blocks use and syntaxanswer k at this code int num 5 printf d 10d 55d 7dn num num num num return 0 Nested and compound ifsanswer Compound ifs When the compound comparison operators ampamp or H are used in an if statement if n gt 5 ampampa 10 printf quotmessagenquot Nested ifs When an if is inside the body of another if statement if n gt 5 if a 10 printf quotmessagenquot Syntax and use of the Ternary operator answer Ternary having three operands There is only one ternary operator that requires three operands it39s the conditional operator we just studied Examples xab agtbab Switch conditional command use of break commandanswer Switch conditional is an algorithm that will contain a series of conditions in which a single variable or expression is evaluated and different actions are taken for each value of the variable or expression double interest int accounttype if accounttype 1 interest 23 else if accounttype 2 interest 26 else if accounttype 3 interest 30 else if accounttype 4 interest 34 else if accounttype 5 interest 39 else all other accounttypes interest 42 switch MultipleSelection Syntax Case1 Case 2 etc quotThe expression is evaluated and compared against each of the case values until there is a match When a match is made the statements to the right of that value isare executed and each set of subsequent statements are executed until the end of the statement break Command Semantics quotWhen the break is executed the current switch command is immediately exited and control of the program continues with the statement that immediately follows the end of the switchquot break Command Syntax break C expressions and their relationship to assignments if xabgt 10 q1 statement like this how else would I write that if xgt10 q1 C Expressions and Assignments All C expressions have a value num 5 x y 2 Their value is the result of the calculation that is performed All C Assignment statements also have a value the value of the variable on the left of the assignment operator xy xabc The value of these assignment expressions is the value of the variable x after the assignment operation has been made We therefore can use C Assignment statements as a portion of the value of a comparision operation Below is an example if total sum 1 lt 5 printf quotdnquottotal The semantics meaning of these statements is quotFirst assign the value of the variable sum plus 1 to total then if total is less than 5 display the value of total The advantage of this minimized approach to this process is to eliminate an additional instruction from the program total sum 1 if total lt 5 printf quotdnquottotal Be careful if you utilize this feature of the assignment operator We pointed out in an earlier section of the notes the common mistake of accidentally substituting the assignment operator when you meant to use the equal comparison operator like the following example if x 1 printf quotWill always happennquot This mistake can be avoided if you practice a simple technique whenever you write an equal comparison When comparing a variable to a constant value always write the constant value first if 1 x printf quotSyntax errornquot This version of the comparison will cause a syntax error from the compiler while the previous version will not cause a syntax error and produce an error in logic at program runtime Additional notes regarding blocks not on test to make blocks printf this is on one d linenquot more strings heren and this is on another line n num printf quotd 10d 5d 7dnquotnum num num num 2222011 55500 PM 2222011 55500 PM


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.