Question

Question 1 Given a value for a, which of these would pick a value for b...

Question 1

Given a value for a, which of these would pick a value for b so that a is half of b?

  a = b/2

   b = 2 * a

   b = 2(a)

   b = 2a

Question 2

What would be the result displayed by the following code?

a = '25'
b = '2'
print(a+b)

Question 3

What kind of error is represented by the following?

length + width = area

logic error

value error

type error

syntax error

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

Hey here is answer to your question.

In case of any doubt comment below. Please UPVOTE if you Liked the answer.

1.    b = 2 * a because it means b is double of as last 2 options are not using operations and first option is just wrong because value of a is gievn not b's.

2. 252 as both 25 and 2 are string so it will just concatenate them both

3. logic error as yeah both side will have integer type but as per login adding length and width is not equal to area

Add a comment
Know the answer?
Add Answer to:
Question 1 Given a value for a, which of these would pick a value for b...
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
  • answer two question,each question has 3syntax errors,find it. 1(a) The following segment of code contains at...

    answer two question,each question has 3syntax errors,find it. 1(a) The following segment of code contains at least three (3) syntax errors that will compilation to fail with errors. Identify each of these errors and specify the solution. [2 marks each, 6 marks in total] cause #include <stdio.h> void main (void) float height; float area; printf "input height of the rectangle: ") scanf( "%f", &height) printf"input length of the rectangle: scanf"", &length); height length; area printf( area of rectangle %f high...

  • Comments used to document code should: A. be used as little as possible B. be insightful...

    Comments used to document code should: A. be used as little as possible B. be insightful and explain what the instruction's intention is C. only be included in code that is difficult to understand D. be used to define variables whose names are not easy to understand E. not be included with the program 2 points    QUESTION 2 The main method for a Java program is defined by: A. public static main( ) B. public static main(String[ ] args);...

  • Questin 1 (CO 2) Which of the following is not a valid name in python? last_name...

    Questin 1 (CO 2) Which of the following is not a valid name in python? last_name lastName last name lname Question 2 (CO 3) How many times will “Hello World” be displayed after the following code executes? num=2 while num<12:     print("Hello world")     num+=2 2 12 5 4 Question 3 (CO 1) The following code contains an error, what type of error is it and what line number is it? 1 count=1 2 while count<4 3    print("count = ",...

  • pick two answers 12 points). The function swap() should swap two integers and main() should print...

    pick two answers 12 points). The function swap() should swap two integers and main() should print those two swapped integers. What (if anything is wrong with this code? Select all that apply. oooo. No ure W..Ni def main(): X = 10 y = 2 x, y = swap(x,y). print(x,y) def swap(a,b): a = b temp = a b = temp main N on line 9, it is illegal syntax to introduce a new variable named temp. Instead, temp should be...

  • The fourth choice D) non of the above For i = 1 To 5 Step 1...

    The fourth choice D) non of the above For i = 1 To 5 Step 1 For j = 3 To 1 Step -1 c (i, j) = Sheet 1.CelIs (5 + i, 6 + j). value Next j Next i Sheet1.Cells (i, j). Value = "DONE" What type of error would occur in the following code? 1) Syntax error 2) Execution error 3) Logic error

  • in python 3.0 please Question 3 (1 point) What is the value of result after the...

    in python 3.0 please Question 3 (1 point) What is the value of result after the following code snippet? num1 = 20 num2 = 10 num3 = 2 result = num1 // num2 / num3 print(result) The code has an error 01.0 0 0.0 0 0.25

  • C Programming Complete the following function by writing C statements that correspond to the description in...

    C Programming Complete the following function by writing C statements that correspond to the description in each comment in the code.             #include <stdio.h> intmain() { // Declare a floating point variable to store a rectangle’s width // Declare a floating point variable to store a rectangle’s length // Declare a third floating point variable that will store the area of the rectangle. // Prompt the user to enter a width for the rectangle. // Get the user’s input, and store...

  • CHAPTER 6 QUESTION 1 Which of these names follows the naming conventions for constants presented in...

    CHAPTER 6 QUESTION 1 Which of these names follows the naming conventions for constants presented in this chapter? a. WeeksInYear b. Weeks_In_Year c. weeks_in_year d. WEEKS_IN_YEAR 1 points QUESTION 2 Which of the following data types can you not use to store the value 500? a. float b. char c. int d. double 1 points QUESTION 3 What values are in the vector named pressures after the following code is executed? vector pressures; pressures.push_back(32.4); pressures.push_back(33.5); pressures.insert(pressures.begin(), 34.2); int index =...

  • 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...

  • The program must be in C# syntax. Write the definition for a generic class called Rectangle...

    The program must be in C# syntax. Write the definition for a generic class called Rectangle that has data members length and width. The class has the following member functions: setlength to set the length data member setwidth to set the width data member perimeter to calculate and return the perimeter of the rectangle area to calculate and return the area of the rectangle show to return a text to display the length and width of the rectangle sameArea that...

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