IB Year 1 Higher Level Computer Science

Monday 12 September 2022 - Block 1
← previous note | most current note | next note →
 

Daily Note

Hello, 

Let's review objective 6

== NanoTech Company == 

In our last class we decided to use JSON to store data. 

We will be continuing to work with files. 

  1. Please review this code and spend some time understanding it.
  2. We will look at this python JSON example
  3. We will continue to learn about working with files
  4. We will create a system for saving new employees to a file
  5. We will then conitnue workring to build a system which includes almost every question we have mapped for our new employee (see classroom whiteboard)
     

We will work objective 7 with whatever time is left. 

More comfortable with software engineering, please work the following problem set, used with gratitude from code wars

 

Description

Here is a matrix(3x3), each element is a positive integer. We don't know all of their values, but we know the sum of each row and each column are equal. This matrix is not complete, please fill in all the numbers.

Task

Complete function completeMatrix() that accepts a argument matrix. This matrix has some null values. Please fill in the correct number and return it.

If the matrix is not possible to complete (the condition is not enough or the value is wrong), please return null.

Examples

matrix=[
[ 10 ,null, 3  ],
[ 4  ,null, 16 ],
[null, 12 ,null]
]
completeMatrix(matrix) should return:
[
[10, 8, 3],
[ 4, 1,16],
[ 7,12, 2]
]
because: 10+8+3=21,4+1+16=21,7+12+2=21  //rows
         10+4+7=21,8+1+12=21,3+16+2=21  //columns

matrix=[
[ 10 ,null, 8  ],
[ null,11, 6 ],
[null, 7 ,null]
]
completeMatrix(matrix) should return null
because the condition is not enough

matrix=[
[ 10 ,null,  8 ],
[null,null,  6 ],
[ 8  ,  7 ,null]
]
completeMatrix(matrix) should return null
because the value is wrong, 
8+6+num and 8+7+num is not possible equal

matrix=[
[null,17,4],
[null,3,null],
[null,1,18]
] 
completeMatrix(matrix) should return null
because the value is wrong, 
the possible result contains negative number

 

 

A little less comfortable

Content

Programs must solve the problem they were create to solve. We can worry about how effieciently or elegantly they solve the problem later on; not right now. The content of a program entails input, processing and output. All three of these elements must be clearly observable. A key question you will be asked (and you should ask yourself) is: to what extent does your code implement the features required by the specification?  

Process

Within the process, we are looking at six guiding questions: 

  • To what extent is your code written well (i.e. clearly, efficiently, elegantly, and/or logically)?
  • To what extent is your code eliminating repetition?
  • To what extent is your code using functions appropriately?
  • To what extent is your code readable?
  • To what extent is your code commented?
  • To what extent are your variables well named?

Product

As opposed to content, this section we focus on how well you solved the problem. A key question here is to what extent is your code free of bugs?

 

A little more comfortable

Content

Programs must solve the problem they were create to solve. You should ask yourself "Am I solving this elegantly?". The content of a program entails input, processing and output. All three of these elements must be clearly observable, and we must see evidence of sanitizing input and raising exceptions.  A key question you will be asked (and you should ask yourself) is: to what extent does your code implement the features required by the specification?  

Process

Within the process, we are looking at six guiding questions: 

  • To what extent is your code written well (i.e. clearly, efficiently, elegantly, and/or logically)?
  • To what extent is your code eliminating repetition?
  • To what extent is your code using functions appropriately?
  • To what extent is your code readable?
  • To what extent is your code commented?
  • To what extent are your variables well named?

For those more comfortable programming, we expect succinct, secure and effecient problem solving. 

Product

As opposed to content, this section we focus on how well you solved the problem. A key question here is to what extent is your code free of bugs? The real difference here is the complexity of the problem you have chosen to solve and how well you solved it. 

Statement of Inquiry

The big idea for today is Programming.

The essential questions for this topic are:

How do we plan, write, execute, and test instructions a computer can understand and process?

It takes time to explore and really understand a big idea. If you want to
learn more about programming (which is connected to today's daily note), please click here .

We are learning this because as a designers must understand scientific and technical innovation. Designers use systems, models, methods, and processes to solve problems.



Reminders & routines:

Please read and follow these reminders:

  1. IF this_class == first_class_of_day:
         read_daily_bulletin()
     
  2. IF today == Friday:
         careers_in_computing()