logo

Crowdly

UCB - MCD4540 Engineering Smart Systems - Trimester 1 - 2025

Looking for UCB - MCD4540 Engineering Smart Systems - Trimester 1 - 2025 test answers and solutions? Browse our comprehensive collection of verified answers for UCB - MCD4540 Engineering Smart Systems - Trimester 1 - 2025 at lms.monashcollege.edu.au.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

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.

View this question

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)

View this question

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. 

View this question

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

View this question

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.

View this question

Select all flowcharts that correctly represent the code provided below:

View this question

Select all valid data structures from the options below.

View this question

Given the following code snippet:

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

View this question

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.

100%
0%
View this question

Want instant access to all verified answers on lms.monashcollege.edu.au?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!