AP Computer Science Principles Exam T1

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

19 Terms

1
New cards

What is a computer?

A general purpose binary state machine made up of electronic components capable of input-process-output.

2
New cards

What are the digits in binary?

0’s and 1’s

3
New cards

What is the base number for hexadecimals?

16

4
New cards

What are the valid digits of hexadecimals?

1-9 and A-F (10-15)

5
New cards

How to convert decimals to hexadecimals?

  • Keep dividing the number by 16

  • Take the amount of times the number can go into the original number and divide it again by 16.

  • Take the remainders of the number from bottom to top as the final number.

6
New cards

What are the 3 control sequences of a structured program?

  • Simple Sequence

  • Decision/Selection

  • Repetition/Iteration

7
New cards

When do you use for loops in C?

Use for loops when you know how many times you want the code to loop.

8
New cards

When do you use while loops in C?

When you do not know how many times the loop will loop. It is usually paired with a condition.

9
New cards

When do you use a do-while loops in C?

Use when you want to ensure the body code to run at least once even if the condition is false.

10
New cards

What is an array?

A variable to holds multiple things in one structure.

11
New cards

What number does the first item in the array starts at?

0

12
New cards

What are command line arguments?

Passing information to the program without prompting the user in the code.

13
New cards

How to write start the command line?

int main (int argc, string argv [])

14
New cards

What does argc do in the command line?

Counts the number of elements are in the argv.

15
New cards

What does argv [] do?

It is where the elements from the command line go to as an array?

16
New cards

What is element 0 in the argv[] array?

It is the name of the program (./programName)

17
New cards

What does Return 0/continue mean?

A integer that gives no errors to the user.

18
New cards

What does return 1/break mean?

There is an error in the input and it kills the code. It’s used to stop code if the command line doesn’t have enough arguments

19
New cards

How do you format a function header?

  • At the top of the code before the int main () and after importation of any libraries.

  • returnType functionName (formal parameters);

  • float CalculateNetPrice (float original, float taxRate );