logo

Crowdly

Browser

Додати до Chrome

UCB - MCD4540 Engineering Smart Systems - Trimester 1 - 2025

Шукаєте відповіді та рішення тестів для UCB - MCD4540 Engineering Smart Systems - Trimester 1 - 2025? Перегляньте нашу велику колекцію перевірених відповідей для UCB - MCD4540 Engineering Smart Systems - Trimester 1 - 2025 в lms.monashcollege.edu.au.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Next, write some code to make the program you've written (in previous parts) into a function.

The function should be named generate_sequence.

The function should not accept any parameters (user input read inside the function instead). 

You should modify the code you wrote in part D to return a dictionary with appropriately named keys containing the information required upon program end (return should take place after the summary is printed).

You should write appropriate function header documentation for the function.

Переглянути це питання

Next, write some code (adding onto the previous part) that meets the following requirements:

  • When the program ends, it should print out a nicely formatted summary of the following information (listed below).
    • number of invalid user inputs  
    • list of all sequences generated (one list per line)

Переглянути це питання

Next, write some code (adding onto the previous part) that validates the input value provided by the user to the following requirements:

  • The user input should should be non-negative (positive), less than 500 and has no more than 3 decimal places.
  • If the input does not meet the requirements above, you should  print the message 'You must provide a valid input' and ask the user for a new input
Note: to check if a given value has no more than n decimal places, you can check if the given value is equal to the same value rounded to n decimal places. 

Переглянути це питання

Next, write some code (adding onto the previous part) that validates the input value provided by the user to the following requirements:

  • The user input should contain an integer value.
  • If the input isn't an integer value, you should print the message  'The value provided is invalid, try again' and ask the user for a new input

Переглянути це питання

Write some code meeting the requirements below (not in a function). You should assume the user will only provide valid input in this part.

  • The program should ask the user for a numeric input which should be saved to a variable named stop.
  • For now, you should cast the user input to an integer
  • Then, generate a sequence of values using the algorithm below:
    1. Generate a list of numbers, that are multiples of both 5 and 7, between 1 and stop.
    2. The last value in the list should be less than or equal to stop.
  • Then, the program should print this sequence of values out as a list of numbers
  • The program should then print an empty line and restart.
  • The program only ends if the user hits CTRL+C.

Переглянути це питання

Select all flowcharts that correctly represent the code provided below:

Переглянути це питання

Select all valid data structures from the options below.

0%
0%
0%
0%
Переглянути це питання

Given the following code snippet:

Select all the valid ways to call this function and print the return value to the terminal/console.

Переглянути це питання

Marking

You are marked on code correctness to the task assigned, as well as adherence to coding standards provided. 

Permitted modules

  • You are allowed to use the math module.
  • No other modules are permitted.

Required Coding Standards

Coding Standards File [ link ]

You must

  • use lowerCamelCase for variable names
  • use snake_case for function names
  • write function header documentation for your answers
  • use four spaces for indentation

I have read the above and understand that if I do not follow coding standards outlined above the attempt will either not be marked or be subject to mark penalties.

Answer "Yes" below to accept the conditions of this test.

Note that if you answer otherwise, your test will not be marked.

0%
100%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на lms.monashcollege.edu.au?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome