Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following Python function prototypes, classify each function call as legal or illegal. Circle one. def f(a, *b): def g(a, b=16): f(1, 2, 3)

  1. Given the following Python function prototypes, classify each function call as legal or illegal. Circle one. def f(a, *b): def g(a, b=16):

    1. f(1, 2, 3) LEGAL ILLEGAL

    2. f(1) LEGAL ILLEGAL

    3. f(1, 'hello', 2) LEGAL ILLEGAL

    4. g(b=2, a=4) LEGAL ILLEGAL

    5. g(32) LEGAL ILLEGAL

  1. (12 points) Given the following C# function prototype, classify each function call as legal or illegal. Circle one. public static void f(params int [] args) { ... }

    1. f(1) LEGAL ILLEGAL

    2. f(1, "hello", 2) LEGAL ILLEGAL

  1. (12 points) A void C++ function named f receives one 2D int matrix consisting of 100 rows and 50 columns. Identify function distinct signatures that could be used for this function. Circle one for each answer. For those that are unacceptable, describe why it is an error.

    1. void f(int M[100][50]) ACCEPTABLE UNACCEPTABLE If unacceptable, describe why:

    2. void f(int M[][50]) ACCEPTABLE UNACCEPTABLE If unacceptable, describe why:

    3. void f(int M[100][]) ACCEPTABLE UNACCEPTABLE If unacceptable, describe why:

    4. void f(int M[][]) ACCEPTABLE UNACCEPTABLE

If unacceptable, describe why:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago