GTI100 Lab 1: Average Sum Game

Verified

Added on  2019/09/19

|2
|724
|135
Practical Assignment
AI Summary
This document outlines the requirements for a practical assignment in the GTI100 course, focusing on the development of an 'Average Sum' game. The assignment requires students to implement a game where players group digits to reach a target sum or average. The game includes features such as random solution generation, a graphical interface with buttons for 'Next,' 'Give Up,' and 'Reset,' and an optional 'Find Mean' mode. The document details the game's logic, interface requirements, and solution generation process, providing a comprehensive guide for students to complete the assignment.
Document Page
Laboratoire 1
GTI100 – Programmation en génie des TI
Durée : 3 semaines
Pondération : 10 %
Scénario
The aim of this laboratory is to perform a small set of numbers using the basic concepts of object-
oriented programming. In this scenario, you are mandated by a company, CasualMathApps, to realize
the prototype of a new set of numbers called Average sum, the basic concept is as follows: Given a
purpose ("Goal" in the example: 73) and a sequence of digits (in the example: 6 3 2 2 6), it is
requested to group the digits for the old names they have Somme gives the desired goal. In the
example: 63 + 2 + 2 + 6 = 73. A player determines the numbers he wishes to group by selecting the
cases: either by clicking on a single name or by clicking on a number and by sliding on the second
one (for example from 6 to 3 to give 63). Each time, a different color is assigned for a new grouping.
The unselected cases are white. In the example, the player to group 6 and 3 for the former 63, and
clicked on the first 2. It has to click on the other digits 2, then 6, to reach 73 and win. All the boxes
must be grouped together. When a player wins, all cases go green. If the player gathers all the cases
and the sum of the numbers formed does not correspond to the goal to be reached, then all cases
turn red. The information is displayed: the goal to be reached, the sum formed by the currently
grouped names, and the current number of groupings made by the player (in parentheses on the
capture).
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Option supplémentaire
In addition, a game option is required: • The Find Mean option requires that the goal is rather the
average of the numbers grouped together. For example: Average of 7 for 6 1 2 5 5 gives 7 = (6 + 12 +
5 + 5) / 4 The option must be activated / deactivated by means of a check box, taken into account in
the following section.
Interface
The graphical interface of the capture is given as an indication, these are the features that are
important. The application must contain three NEXT, GIVE UP and RESET buttons, operating as
follows:
NEXT New game
GIVE UP Displays the solution, coloring the right numbers
RESET Returns the player's groupings to zero, and returns all the boxes to a
white background
Création d'une partie
The creation of a game is done by generating a solution in the following way:
1. Random choice of a number between 3 and 6 inclusive which represents the number of groupings
in the solution (for example 4)
2. For each grouping (i.e. number), one chooses, with a probability of 0.7, a number between 1 and 9
included, otherwise a number between 10 and 99 inclusive (e.g., 23, 5, 11, 6)
3. The generated numbers (displayed in the console) can then be: 1. summed, to give the goal to be
reached (23 + 5 + 11 + 6 = 45) 2. concatenated, to obtain a sequence of digits to be displayed in the
boxes (235116)
4. In the case of an average, a solution must be found so that the division of the numbers obtained is
an integer (for example, 45/4 does not give an integer, it is necessary to modify the numbers
generated so that their sum gives 44 or 48, which would give 11 or 12 as the goal)
5. The numbers obtained must be saved as a solution which will be used to test whether the
groupings are valid, or if the player decides to give up (with the GIVE UP button).
chevron_up_icon
1 out of 2
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]