Describe characteristics of a complex problem

Assignment Help Python Programming
Reference no: EM133087642

ITECH1400 Foundations of Programming

Question 1. Briefly describe four key characteristics of a complex problem.

Question 2. In your own words, describe what debugging source code is and explain why may need to debug our code. Name the category of software tool used to debug source code.

Question 3. Sort the following series of values into ascending order using the Bubble Sort algorithm. Write out the complete row of numbers each time two values change places and circle the two values that have changed places.

Question 4. When testing software we may either perform black-box testing or white-box testing. Describe the key characteristics of each of these testing methods. If we were performing unit-testing, which of these to testing methods would we be using?

Question 5. In your own words explain what type of data can be stored in the following primitive data types: integer, float, string and boolean.

Question 6. In programming we use for-loops to either run sections of code a specific number of times, or to iterate over lists. In this question we're looking at the latter of these uses where we'll work with lists generated via the range statement. As such, write code that will:
a.) Print out the values 1 through 10 inclusive (i.e. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10).
b.) Print out the values 10 through 20 inclusive in steps of 2 (i.e. 10, 12, 14, 16, 18, 20),
c.) Print out the values between 10 and -11 in steps of -3 (i.e. 10, 7, 4, 1, -2, -5, -8, -11).

Question 7. In terms of programming, in your own words describe what a function is and how functions operate. In what way are functions different to methods? In your answer be sure to mention any input characteristics a function may have (i.e. arguments / parameters) and any return types.
Also, briefly explain the difference between an argument and a parameter.

Question 8. When writing programs we may want to persist data so that the data exists on file rather than just in memory while the program is running. Write a small amount of code which will write the following list of groceries to a file called shopping_list.txt (with each item on a separate line) and then save and close the file:
groceries = ['Bread', 'Milk', 'Sugar', 'Oranges']

Question 9. Write Python code to create a class called Car which represents a car. The Car class should have properties of make, model and owner (i.e. whose car is it). The class should also have a constructor that takes these parameters to initialise the object, and a method called drive that prints out the phrase 'The car drives away into the sunset...' to the screen.
After you have defined the Car class, create a Car object called test_car with a make of 'Ford', a model of 'Focus' and an owner of 'Emily'. Once the object has been created, call the drive() method on it.

Question 10. When writing programs, one of the goals of our programs is that they do not crash - and one mechanism that we may use to ensure that our programs are robust is to use exception handling.
Briefly explain what exception handling is and how we can use it to ensure our programs don't crash.

Question 11. Software libraries are pieces of code that perform functionality that may be time- consuming or difficult for us to write ourselves. As such, by using a software library we can cut down on development time.
In your own words, and with respect to software libraries which can be used with the Python
programming language, explain how you might go about performing the following tasks:
a.) Identifying suitable libraries,
b.) Obtaining any suitable library you've identified, and
c.) Using the software library (just in general, not how to use a specific software library).
In your answer name two examples of specific software libraries that you have used during this course.

Question 12. When writing software that uses a graphical user interface (GUI) our program will operate using the mechanism of event driven programming.
Explain what event driven programming is and how it operates. In your answer, briefly discuss how event driven programming operates differently from standard 'procedural / command-line' programming.

Question 13. When profiling a computer program, two of the main things that we want to identify are
bottlenecks and hotspots. In your own words explain what bottlenecks and hotspots are.

Question 14. The way in which high-level source code (such as a Python .py file) is translated into machine code suitable for execution can be broken down into three main areas:
- Interpretation,
- Compilation, and
- Hybrid Techniques.
Very briefly explain the key characteristics of each of the above high-level to low-level source translation mechanisms.
Finally, rank the typical execution of speed of each into the categories of: Fastest, Slowest and
Intermediate.

Question 15. When solving problems we may decide to use the six-step problem solving process in order to solve it. List down the commonly accepted six steps and the order in which they occur if this process is to be used.

Question 16. Below is an algorithm (i.e. a series of steps and the sequence in which they should be performed) to perform the operation "Make a cup of tea for someone".
1) Boil at least 200ml of water,
2) Find a clean cup,
3) Put a teabag in the cup,
4) Pour the boiling water into the cup until it is three quarters full,
5) Leave the tea to brew for a few minutes.
6) Ask whether the person takes sugar in their tea.
a) If so, add the required number of sugars into the cup.
b) If not then simply continue.
7) Ask whether the person takes milk in their tea.
a) If so, add a small amount of milk into the cup.
b) If not then simply continue.
8) Stir the tea and serve it to the person.

Draw an activity diagram / flowchart of this process. In your answer, be sure to use the correct symbols for:
- Starting the process (a circle),
- Ending the process (a circle with a black centre),
- A process (a rectangle), and
- A decision (a diamond).

Attachment:- Foundations of Programming.rar

Reference no: EM133087642

Questions Cloud

Discuss and evaluate compulsory vaccination : Discuss and evaluate compulsory vaccination: Immunizing the population against disease and Describe the public health purposes of screening
Determine the depreciation expense for the year ending June : The machine was six months old at June 30 and had been used for 3,800 hours. Determine the depreciation expense for the year ending June 30
Calculate the depreciation expense at the end : On January 1, your company purchased an item of plant for $407,000 ($370,000 + $37,000 GST). Calculate the depreciation expense at the end
Calculate the bev in units : They buy Cangaro at $5.50 per bottle and spend another $0.50 per bottle for transportation to their shop. Calculate the BEV in units
Describe characteristics of a complex problem : Describe four key characteristics of a complex problem and describe what debugging source code is and explain why may need to debug our code
How much will dennis receive : To realize this, Mrs. Coronacion will invest P2,500 at the beginning of each year after Dennis turns 7. How much will Dennis receive at the age of 19
Compute the company payback reciprocal : Question - A machine costing P8,350 yields total cash flows of P.13,100 over 5 years. Compute the company payback reciprocal
What is your rate of return : You buy stock for $20.8 per share and sell it for $28.8 after holding it for slightly over year and collecting a $1.9 per share dividend. What is rate of return
Write for loop code fragment using only a while loop : Briefly describe each model including a diagram and What are the main differences between the two models

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd