Introduction To Coding & Computational Thinking Exercises
Introduction To Coding & Computational Thinking Exercises
Solution Steps:
Step 1: Decompose the Trip
1. Transportation: Decide on the best method to travel to Bauchi State, either by road
or air, based on cost and convenience.
2. Accommodation: Find suitable lodging near Yankari Game Reserve that can
accommodate the group.
3. Itinerary: Plan activities at Yankari Game Reserve, considering daily schedules,
activities available at the park, and time for meals.
4. Meals: Budget for three meals daily for each participant, with emphasis on
affordable yet enjoyable options.
1. Transportation Patterns:
○ Flight costs fluctuate based on booking time; booking in advance reduces
costs.
○ Road travel costs can increase with fuel price hikes, and car rental charges
vary by vehicle type and mileage.
2. Accommodation Patterns:
○ Lodges around Yankari Game Reserve offer group discounts if rooms are
booked in bulk.
○ Accommodation costs may also vary depending on the day of the week, with
weekends generally pricier.
3. Itinerary Patterns:
○ Guided tours and safari activities have specific times; planning around these
schedules saves time and ensures participation.
○ Some activities (like night safari tours) may cost extra, so budgeting for
these in advance is essential.
1. Choose Transportation: Compare flights vs. car rental costs, accounting for the
budget and time constraints.
2. Book Accommodation: Find group lodging, focusing on budget and proximity to
Yankari Game Reserve.
3. Plan Daily Itinerary: Include a safari tour, spring visit, and other available
activities.
4. Set a Meal Budget: Decide on daily meal expenses to keep the total trip cost within
budget.
Final Plan:
1. Transportation:
○ Option: Round-trip car rental for flexibility and cost-effectiveness.
○ Cost: ₦400,000 for a 7-seater SUV with fuel and tolls included.
2. Accommodation:
○ Yankari Tourist Camp: Group lodge with rooms available at ₦50,000/night
per room for 3 rooms, totaling ₦450,000.
○ Total for 3 nights: ₦450,000
3. Itinerary:
○ Day 1: Arrival and settle into accommodations
○ Day 2: Morning - Safari tour (₦50,000), Afternoon - Visit to Wikki Warm
Springs (₦30,000)
○ Day 3: Morning - Guided hike (₦20,000), Afternoon - Game viewing and
nature walk
○ Day 4: Departure
○ Total Itinerary Cost: ₦100,000
4. Meals:
○ Budget: ₦25,000/day for 6 people
○ Total: ₦100,000 for the trip
Problem Statement:
Plan a group trip that meets the following requirements:
Solution Steps:
Step 1: Decompose the Trip
1. Simplify the focus by listing only critical steps necessary for planning:
○ Choose a transport mode (e.g., car rental) based on cost and convenience.
○ Select accommodation that fits the group size and budget.
○ Decide on main activities (one per day) to minimize costs while ensuring
variety.
○ Set a daily budget for meals to keep overall costs within budget limits.
2. Create a Budget Summary:
○ Divide the $3,000 total into estimated amounts per category:
■ Transportation: % (₦ )
■ Accommodation: % (₦ )
■ Itinerary/Activities: % (₦ )
■ Meals: % (₦ )
3. Adjust based on necessity, prioritizing accommodation and transportation.
Instructions:
Step 1: Define the Objective
Our goal is to create a function in Python that will automatically generate a thank-you
message when given a person’s name and their completed task or purchase.
Example output:
1. Now, let's test the function by calling it with different names and tasks.
2. Each test will print out the generated message.
1. Be creative and test your function by calling it with different names and tasks.
2. Confirm that each test prints out the correct message.
Hands-On Exercise 3: Automating a Daily Checklist in Python
Objective
Learn how to use Python to create a daily checklist that you can reuse every day by simply
running the script. The checklist will prompt users to complete each task, mark it as "done,"
and display a summary at the end of the day.
Expected Output
Initial Output: The script will display each task, one at a time, prompting the user to mark
each as completed.
Daily Checklist:
Summary Output: After responding to all tasks, a summary will show which tasks are
"Done" and which are "Not done".