Inquiry on developing a Python program for cumulative addition of variable inputs [closed]

Consider the following scenario: I establish a daily fitness goal, such as completing 100 push-ups. Initially, I perform 10 push-ups and later in the day, I return to complete an additional set of 10. My intention is to seamlessly integrate the newly achieved 10 push-ups with the earlier set, allowing a program to accumulate these increments cumulatively. Consequently, by the day’s end, I can effortlessly review the total count of push-ups accomplished.

In contemplating a solution, I envision developing a compact Android application centered around this concept. It need not be restricted to push-ups; rather, it can encompass diverse activities such as tracking the total number of steps taken, coding problems solved on platforms like LeetCode, or the quantity of words written in a given day.

Despite lacking a background in computer science, I hope I was able to articulated my non-technical requirement in a manner that is accessible and comprehensible.

A pseudocode:

// Define variables
    goal = 100                                // Set the daily goal
    currentCount = 0                          // Initialize the current count

 // Function to increment count
    function incrementCount(amount):
    currentCount = currentCount + amount

// Function to update UI
    function updateUI():
    display("Total Count: " + currentCount)   // Update the UI with the current count

// In the Android app:

// When the app starts or the day resets
    onStartDay():
    currentCount = 0                          // Reset the count to zero
    updateUI()                                // Update the UI to show the initial count

// When the user performs an activity (e.g., push-ups, steps, coding problems solved, words written)
    onActivityCompleted(amount):
    incrementCount(amount)                    // Add the current activity's count to the overall count
    updateUI()                                // Update the UI to reflect the new total count

  • Sorry, but this site is not a programming service. This site is here to help if you have a concrete technical problem when trying to implement these requirements yourself.

    – 

Leave a Comment