Question

Question 1 The following function header represents which programming language? double calc_weekly_pay( double hours_worked, double pay_rate)...

Question 1

The following function header represents which programming language?
double calc_weekly_pay( double hours_worked, double pay_rate)

Question 1 options:

Python

A C-based language

FORTRAN

COBOL

Question 2

One of my favorite quotes from Jeanette Wind is "Computational thinking is using abstraction and decomposition when attacking a large complex task or designing a large complex system."
This supports using _____________ when developing programs.

Question 2 options:

Repetition structures

Assignment statements

Selection structures

Functions

Question 3

The following assignment statement exhibits which of the following?
test_1 + test_2 +test_3 + test_4 = total_score

Question 3 options:

a syntax error

a system error

a semantic error

a type conversion error

Question 4

The block of code shown below is a
def display_list(my_list):
for value in my_list:
print ("\n", value)

Question 4 options:

value returning function

a control structure

a void function

a null function

Question 5

The following assignment statement exhibits which of the following?
test_1 + test_2 +test_3 + test_4 = sum_of_scores

Question 5 options:

a syntax error

a system error

a semantic error

a totally correct statement

Question 6

The value of a constant is

Question 6 options:

set once and not changed again

able to be changed any number of times, but only under very specific circumstances

able to be changed any number of times, but only outside the function where it was originally declared

able to be changed any number of times in statically typed languages only

Question 7

In a dynamically typed language such as Python, what does the following statement do?
total = 0.0
choose as many as seem true to you

Question 7 options:

create a variable named total

assign the variable the value 0.0

bind the variable to type double

assign the variable the type int

Question 8

total = 0.0
total = "my cat sleeps all day"
The preceding sequence of statements does which of the following

Question 8 options:

changes the type of total from double to string in a dynamically typed language

changes the type of total from double to string in a statically typed language

raises an error in any language because the type conversion is invalid

works only when a special conversion function is invoked

Question 9

def calc_celsius(fahrenheit):
celsius = (5.0/9.0) * (fahrenheit - 32.0) # convert Fahrenheit to Celsius
return celsius
The preceding code is a(n)

Question 9 options:

void function definition in C

void function definition in Python

value returning function definition in C

value returning function definition in Python

Question 10

double calcMilesDriven ( double startingMiles, double endingMiles)
{
double milesDriven = 0.0 ;
milesDriven = endingMiles - startingMiles ;
return milesDriven ;
}

The preceding code is a(n)

Question 10 options:

void function definition in C

void function definition in Python

value returning function definition in C

value returning function definition in Python

Question 11

The keywords "for" and "while" are used to begin ______________ in many programming languages.

Question 11 options:

Selection statements

Repetition statements

Assignment statements

Function headers

Question 12

Both variables and constants serve which of the following purposes (select as many as are appropriate):

Question 12 options:

They are symbols that refer to concepts used in solving a problem

They point to an area in memory where a value is stored

They indicate what type of data these symbols represent

They enforce semantic integrity

They enforce syntactic integrity

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

double calc_weekly_pay( double hours_worked, double pay_rate)

This represents a C Based Language

2.

This supports using _____________ when developing programs

Selection Structures

3.

test_1 + test_2 +test_3 + test_4 = total_score

This is a

Semantic error

4.

def display_list(my_list):
for value in my_list:
print ("\n", value)

The block of code shown above is a

void function

Note: at a time max we can answer only 4 question as per HomeworkLib policy.

Explanations

1. double calc_weekly_pay( double hours_worked, double pay_rate)

This is a function having name calc_weekly_pay which will return a double value.

This function takes 2 parameters hours_worked and pay_rate.

Another c function for example is given below:

int sum(int a, int b)

2.

Computational thinking is using abstraction and decomposition when attacking a large complex task or designing a large complex system.

This statement means that there is separation of concerns. It's like selecting an appropriate representation for a particular task.

3.

test_1 + test_2 +test_3 + test_4 = total_score

This is a semantic error because compiler will show error as lvalue required as left operand of assignment

Correct semantic will be

total_score = test_1 + test_2 +test_3 + test_4

 

4.

def display_list(my_list):
for value in my_list:
print ("\n", value)

This is a void function,as display_list is a function which is not returning anything.

Add a comment
Know the answer?
Add Answer to:
Question 1 The following function header represents which programming language? double calc_weekly_pay( double hours_worked, double pay_rate)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ requirements All values must be read in as type double and all calculations need to...

    C++ requirements All values must be read in as type double and all calculations need to be done using type double. For part 2 you MUST have at least 4 functions, including main. The main function will be the driver of the program. It needs to either do the processing or delegate the work to other functions. Failure to follow the C++ requirements could reduce the points received from passing the tests. General overview This program will convert a set...

  • The following question is based on Python programming language. Consider the function open(). a) What does...

    The following question is based on Python programming language. Consider the function open(). a) What does open() open? b) What is the difference in possible actions you can take using the object returned by open() if you pass the argument 'r', 'w', or 'a'?

  • Question 1 What is the value of x after the following int x = 5; x++;...

    Question 1 What is the value of x after the following int x = 5; x++; x++; x+=x++; A)14 B)10 C)13 D)15 Question 2 The last line in value returning function (before the }) should contain the word return. True False Question 3 This contains three parts: Void or Data Type the name optional parameter list A)Menu System B)Function Header C)Switch Question 4 What is a variable? A)a pointer B)a place in memory to hold data C)int D)a computer programming...

  • QUESTION 1 Given two double variables named x and y, which of the following statements could...

    QUESTION 1 Given two double variables named x and y, which of the following statements could you use to initialize both variables to a value of 0.0? a. x | y = 0.0; b. x = y = 0.0; c. x, y = 0.0; d. none of the above 1 points    QUESTION 2 When you use a range-based for loop with a vector, you a. can avoid out of bounds access b. must still use a counter variable c....

  • Language is C++ Basic principles and theory of structured programming in C++ by implementing the class:...

    Language is C++ Basic principles and theory of structured programming in C++ by implementing the class: Matrix Use these principles and theory to help build and manipulate instances of the class (objects), call member functions Matrix class implementation from the main function file and, in addition, the Matrix class must have its interface(Matrix.h) in a separate file from its implementation (Matrix.cpp). The code in the following files: matrix.h matrix.cpp matrixDriver.h Please use these file names exactly. Summary Create three files...

  • Question 1 1 pts Which of the following is not a valid class name in Java?...

    Question 1 1 pts Which of the following is not a valid class name in Java? O MyClass MyClass1 My_Class MyClass# Question 2 1 pts Which of the following statements is False about instance variables and methods? Instance variables are usually defined with private access modifier. Instance variables are defined inside instance methods. Instance methods are invoked on an object of the class that contains the methods. A class can have more than one instance variables and methods. Question 3...

  • Let's fix the displayMenu() method! First, edit the method to do the following: We want to...

    Let's fix the displayMenu() method! First, edit the method to do the following: We want to also allow the user to quit. Include a "Quit" option in the print statements! Have it get the user input from within the method itself and return an int based on the user's choice. (Make sure to also edit the method header and how it is called back in the main() method!) What is the method's return type now?                  ...

  • Question 1 (1 point) Which of the following is a reason to use functions? Question 1...

    Question 1 (1 point) Which of the following is a reason to use functions? Question 1 options: To make it easier to read by keeping sections of code shorter. To avoid duplicating code. all of the above To make the code more organized. Question 2 (1 point) When the execution of a function ends, what Python code is executed next? Question 2 options: The function is automatically executed again. The line of code immediately after the end of the function....

  • Python Programming QUESTION 16 Which of the following is an example of a Keyword in Python?...

    Python Programming QUESTION 16 Which of the following is an example of a Keyword in Python? elif class for All of the above QUESTION 17 Which of the following is not an acceptable variable name in Python? 2ndVar $amount Rich& ard None of the above are acceptable variable names QUESTION 18 The number 1 rule in creating programs is ___________________- Write the code first Think before you program Let the compiler find you syntax errors There are no rules just...

  • in C language we need to find the following : EXERCISE 3: 1. Write the definition...

    in C language we need to find the following : EXERCISE 3: 1. Write the definition of a structure named employee that contains character array members for an employee's first and last names, an int member for the employee's age, a char member that contains 'M' or 'F' for the employee's gender, and a double member for the employee's hourly salary. 2. Using the above mentioned definition, write a C program that asks a user to enter the values of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT