Accept the assignment
You have two sections, one is a quiz and the second is a set of flowchart exercise.
The repository template has already a file called quiz-answers.txt. Edit it directly instead of creating a new file.
Why do programmers typically use a repository for their software projects?
To keep track of changes
To make code run faster
To backup their code in the cloud
To replace the need for testing
Which of the following is/are correct?
A start block can have multiple flowlines going out of it.
An end block can have multiple flowlines going out of it.
A condition can be nested in another condition.
A compound condition tests multiple conditions at once.
A condition has usually two flowlines going out of it, one for true and one for false.
If we want to count from 1 to 10 in a flowchart, which of the following to we typically use?
Variable
Condition
Process
Terminal
Flowchart¶
Similar to Exercise 3, draw the following flowcharts. You can use all shapes.
The files must be named similar to how you named them in Exercise 7. Create one file for each flowchart, e.g., flowchart1.svg.
You want to draw the face of your friend on a canvas.
You draw the oval for the face borders and three guidelines (for the center and the nose), and end your session.
You want to plan a bikepacking trip for n days and want to plan your trip to another country. You assume an average speed of 20 km/h. You want to bike about 6 hours per day. For warming up, you plan only 3 hours on the first day.
You calculate the total distance you can bike using a formula.
You are an engineer at Uber.
Input current demand and driver_count. If demand > 2× drivers, apply high pricing, otherwise normal.
You are programming a role playing game. You want to code the effect of an attack.
Input the attacked player’s health and and whether spell_shield_is_active. Generate a random number between 1 and 10 as attack_strength. If the spell shield is active, then reduce health by the half of the attack strength, otherwise reduce health by the full attack strength.
You are coding part of a first person shoother game.
Input the x coordinate of player’s shot shot_x and compare it with the targets’ x guess and compare it with the target’s borders on the x axis target_x_left and target_x_right. If the shot is within the target’s borders, output Hit!, otherwise output Miss!.
You are coding an app for calculating required protein intake for fitness.
Input weight in kg and activity_level (1, 2, or 3). If activity level is 1, then required protein intake = weight × 0.8. If activity level is 2, then required protein intake = weight × 1.2. If activity level is 3 or 4, then required protein intake = weight × 0.5 × activity level. Output the required protein intake.
You are a ham radio operator who wants to record distant stations. To save power, you shut down the receiver during the day, because long-distance signals travel better after dark.
Input whether is_nighttime and the signal_strength.
You ate with your friends in a restaurant and want to split the bill. Ask how many people (n) are splitting the bill. For each person, ask how much they want to contribute, add it to the total. Output the total.
You are cutting a piece of string with length string_length into equal pieces of piece_length. You want to output piece_count, how many pieces you can cut.
Finally, find a process from your daily life. It should at least contain a decision, an input, and output.
Write the process down in text as flowchartN-description.txt and draw its flowchart.