30 simple programming multiple choice

profilepotrero
FundamentalsofSoftwareDevelopmentMidtermExam.pdf

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 1/13

Midterm Exam

 This is a preview of the published version of the quiz

Started: Apr 12 at 8:27am

Quiz Instruc�ons

Do not click on the link to start the Midterm unless you are ready to begin AND complete the test in one sitting. You may not retake the test, nor can you stop the test and continue at a later time. Please read the Announcements regarding this test before taking it. Also, read these Instructions carefully. This exam covers concepts from the 1st half of the course. No programming is required for this exam; it is entirely multiple-choice and fill-in. The exam will be automatically graded and your score presented. It can also be found under Grades.

You are to do this exam without assistance from classmates or others. You should take no more than 70 minutes to complete this exam of 30 questions. 2 points will be deducted for each full minute over 70 you take to submit the exam. For this exam, no grace period other than this is allowed. Please leave enough time in case Canvas takes a long time (like a minute) to register your exam after submitting your answers. I will ONLY go by the Canvas-reported time for this test.

Please choose the best answer for each question.

1 ptsQuestion 1

is completed after the specs have been developed.

occurs after coding is completed.

occurs throughout the entire process. Specs are part of the documentation.

is best subcontracted out to a professional publishing firm.

In a general Software Development Process, documentation development:

1 ptsQuestion 2

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 2/13

Ask the user to input the multiplier into the program each time it is run (using a prompt with printf and scanf)

Use this number directly in the expressions that need it.

Use a variable (such as float loadedmultiplier; and assign it the value of, say, 1.2, down in the code of the program.)

Use a defined constant (such as const float loadedmultiplier = 1.2;)

You own an office building, and are writing a program that calculates rents based on square footage. Your inputs will be the number of rooms an office suite has along with the actual square footage. You use something called a "loaded footage multipler" so that you can properly allocate the costs of your hallway and lobby space to each suite. This might be a number such as 1.07 or 1.2. Actual footage is always multiplied by this number to arrive at the chargeable square footage. You like this number, have been using it for the past 10 years, and plan to use it in your building for at least 3 years. You are the programmer and can recompile the source code at any time. Stylewise, how should you best incorporate this value into your program?

1 ptsQuestion 3

age = 23 * yukko (18);

printf("%d", yukko(34.56));

age = yukko (34.56);

yukko (34.56);

If yukko is a function that takes in a float expression and returns an integer (int) value, which of these calls is illegal/inappropriate? Assume age is integer.

1 ptsQuestion 4

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 3/13

Algol 60

C++

Java

Python

C is a modern programming language that was strongly influenced by which predecessor:

1 ptsQuestion 5

machine language

high-level language

object-oriented programming language

database language

C is an example of what type of programming language?

1 ptsQuestion 6

do-while

for

goto

while

The typical file-input/batch data processing loop uses which looping structure?

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 4/13

1 ptsQuestion 7

a completely interactive system

a batch / file input system

a system with both interactive and file input elements

an intranet

A technology store is planning to adopt a new cashiering/inventory system. How would you best describe this system?

1 ptsQuestion 8

parameters

arguments

variables

invariants

When calling a function (say, in the main function), the items placed in the parentheses are most often referred to as? (refer to the lectures for this)

1 ptsQuestion 9

You are involved in creating a program to do e-commerce. Your team has developed most of the software, but you need something that provides validation of individual credit card numbers. Fortunately, Union Bank has developed a package that can work with yours and is willing to partner with you to provide this component. In problem-solving language, having Union Bank provide this component is most indicative of specifically which approach?

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 5/13

Asking questions

Divide and Conquer

Linear

Building Block

1 ptsQuestion 10

Nested if

do-while loop

nested loop

linear-nest if

If you are trying to detect if the value of a float variable is in one of several ranges, the best construct to use to do this is:

1 ptsQuestion 11

a process which allows the programmer to connect several pieces of source code together in one big editor file.

a process which allows multiple Internet sites to run a single program that is based at a certain site.

an operating system process that allows an end-user to connect to a 2nd program immediately following the termination of the 1st program.

the binding together of the object code with the already-compiled library modules, and resolving the addressing of the function calls.

The linkage editor provides a service called "linking". Linking is:

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 6/13

1 ptsQuestion 12

scanf("%13.2f", price);

scanf("%13.2f", &price);

scanf("%f", price);

scanf("%f", &price);

You have to write an interactive statement which reads an amount (the price of a house). Which of the following would be the best statement to do this?

1 ptsQuestion 13

letters and digits

operators and operands

variables and operators

numbers of various types

Expressions are made up of:

1 ptsQuestion 14

Burndown Chart

Pseudocode, Nassi-Shneiderman Chart, Flowchart

Nassi-Shneiderman Chart and Burndown Chart

The action: Increment the count by 1. could be found in which design tools?

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 7/13

Hierachy Chart only

1 ptsQuestion 15

stuff = fopen("c:\\class\\numbers.txt","w");

stuff = fopen("c:/class/numbers.txt","w");

stuff = fopen("c:\class\numbers.txt","w");

stuff = fopen("numbers.txt","w");

Which of the follow fopen() calls is improper for setting up an external file to be written (Dev C++ program running on Windows):

1 ptsQuestion 16

editor

assembler

compiler

linker

Which program transforms a high-level language like C into machine-language or low- level code?

1 ptsQuestion 17

sequence, looping, selection

The three types of flow-of-control (logic) structures are:

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 8/13

expression, looping, selection

do while, while, for

sequence, invariant, post-radix

1 ptsQuestion 18

fprintf()

printf()

scanf()

fgets()

To output a string to a disk file, you would use which function?

1 ptsQuestion 19

the ordering of the statements in the program.

the detail of the various loops and selection constructs in the program.

the relationship of the program's modules to each other.

the program's flow-of-control.

The hierarchy chart shows:

1 ptsQuestion 20

For a typical interactive do-while loop that terminates based on a user response, the loop invariant statement is typically:

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 9/13

printf

scanf

fscanf

an assignment statement

1 ptsQuestion 21

True

False

Every single statement in a C program must have a comment immediately following it to describe what's happening in "human" terms.

1 ptsQuestion 22

divide-and-conquer

building block

asking questions

linear

When consulting with your user in the initial phases of a project, which of these approaches will you likely undertake first?

1 ptsQuestion 23

In a typical commercial business application, it is usually possible to eliminate all bugs prior to release of the first or second version.

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 10/13

true

false

1 ptsQuestion 24

TRUE (1)

FALSE (0)

0

Not enough information to determine this

In C, if balance has the value 0.0 and there is no more data to be read in the file called finance, what is the value of this expression: balance < 0 || feof(finance)

1 ptsQuestion 25

Production

Maintenance

Alpha Test

Beta Test

The point in the development cycle when the software product is released or sold to users for active "live" or "real" work.

1 ptsQuestion 26

You are the product manager of Zoomie! -- a utility for Windows. Last month you released version 2.5, which introduced a couple of new capabilities over 2.0. You just fixed a

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 11/13

production

maintenance

code

post-radix

couple of insidious bugs that were important to fix to please your user base. You are naming this new version 2.51. What type of release is this best referred to as?

1 ptsQuestion 27

printf("**$%7.2f**%4d", amount, grade);

printf("**$%7.2f**%d", amount, grade);

printf("**$%3.2f**%4d", amount, grade);

printf("**$%5.2f**%d", amount, grade);

Which of these would most likely produce the following output? (Assume that amount has the value 345.6123 and grade is an int variable with the number 4 in it. Also, there is one space prior to the 3 below [may be a little hard to see]).

**$ 345.61**4

1 ptsQuestion 28

16

22

26

What is the value of the following C expression? 2 * 3 + 5 * 4 / 2

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 12/13

Quiz saved at 8:31am

32

1 ptsQuestion 29

fgets(city, 12, inputfile);

fgets(city, 20, inputfile);

fscanf(inputfile, "%20s", &city);

fscanf(inputfile, "%s", &city);

You need to read from a data file a city name. It is a California city. You have control over how you will set up the data file. Which would be the best statement to use? Assume city is a string variable and inputfile is a properly defined file variable.

1 ptsQuestion 30

user stories

general specifications

network specifications

input/output specifications

As systems analyst for Zydeco Ultraspan, you are helping to design a program to handle customer complaints. On-screen, the user will select from a full word describing the complaint. However, stored in the file on disk will be the complaint stored as a simply a character code. Which section of the specifications would most likely enumerate the various character code that will be stored?

Submit Quiz

4/12/2018 Quiz: Midterm Exam

https://my.uclaextension.edu/courses/11549/quizzes/21959/take?preview=1 13/13