Eve Wein

Greenhorn
+ Follow
since Nov 19, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eve Wein

John Matthews wrote:Where the average is calculated, the ones you've helpfully marked [b] in your original post.


Ah, I got it! Thank you.
3 weeks ago

John Matthews wrote:Thanks. I just added a printf() in the code where the average score is calculated and played one round - the printf() showed the average being updated correctly.

Then I was about to play my 2nd round - entered 'P' - and the printf() output again; my first round score had been added to allScore again, so it was no longer correct.

Try adding some printfs yourself - it's a simple way to debug code, doesn't need a fancy debugger.

Thank you, may I ask which line of the code are you referring to?
3 weeks ago

John Matthews wrote:Hi Eve - please could you post the rest of the code as well so I can compile it?

Sure, John! I have tried sending the complete code, but received a "Post is too long, please shorten it. Alternatively you can buy some Pie from an upper menu to increase a post limit by 10000 characters per pie slice," warning. So I have posted my code to this link https://paste.ubuntu.com/p/7ZVmwnsX22/ feel free to check it out!
3 weeks ago
C program.

Problem: Faulty average score output.

My program gives faulty average score output, no matter how I debug it, it is still there, and it has become a pain in the ass lol.



Any help would be greatly appreciated.
3 weeks ago
C program.

The problem I'm facing:

I need to press the 'Enter' key twice after typing the letter 'P' if I want to output the next sentence. I'm pretty sure that previously I just needed to press the 'Enter' key once in order to do so. What's surprising is that typing the letters 'S' or 'R' will only require pressing the 'Enter' key once to get the desired results. What could have possibly gone wrong?

1 month ago
C program. IDE used is Xcode v12.2.

The problem I am facing:

Faulty scores output. For each round, the program should output the highest and lowest scores and the average score.

What I have tried:


Scores output after playing for 1 round:


Scores output after playing for 2 rounds:


Questions:

In the first pic, why is ‘Round 1’ shown as ‘Round 0’? And what does the ‘inf’ mean in the average score section? Please help me turn ‘inf’ into a numerical output. The same thing happens after playing for two rounds.

Any help would be greatly appreciated.
1 month ago

John Matthews wrote:Never heard of that before, but looks interesting:
https://code2flow.com/

Presumably the free version doesn't meet your requirements, and if not, is paying $11 for (just) a month of the full version not an option?



I just need it for a presentation session, so I might just draw it using draw.io if no one else has it.
1 month ago
Hi, does anyone have a code 2 flow premium account? I need to generate a flowchart for a program of mine, to provide better visuals and clarity of thought during my presentation session.
1 month ago


I have written a program in C language. The program is designed for primary school students in Grades 1-2. Two integers are randomly selected, the numbers are either added or subtracted to form an equation, and the students are asked to solve the equation.

Code criteria:
a. Each round of the game consists of 10 questions that are not to be repeated. 10 marks for each question. Each round of games is required to be set anew and is not have the same questions as the previous rounds.


b. Only the addition and subtraction within 100 is allowed, the sum and difference of the two numbers should not exceed the range of 100, and is not to have a negative value.


c. For each question, players have 3 chances to enter their answers. 10 points are awarded for the first correct attempt, 7 points for the second attempt, 5 points for the third attempt, zero points if all 3 attempts failed. When an incorrect answer is entered, a message should appear prompting the student to re-enter the answer. Output the correct answer if all 3 attempts are used in the form "No, the answer is X".


d. At the end of the test, a message should appear prompting the player to choose "Show results", by entering the letter "S", "Play another round", by entering the letter "P", and "Quit", by entering the letter "Q". If the player entered "S" after one round of the game, output the player's score (marks/100). If the player chooses "Show results" after multiple rounds of the game, the output should include the player's highest score/%, lowest score/%, and the average score/% of all games played. If the player enters "Q", the program ends.


e. Include fault tolerance function, a simple menu interface, necessary notes. The program should also meet the requirements of modularization and structurization.

This is my code:



Code criteria not fulfilled:

d. At the end of the test, a message should appear prompting the player to choose "Show results", by entering the letter "S", "Play another round", by entering the letter "P", and "Quit", by entering the letter "Q". If the player entered "S" after one round of the game, output the player's score (marks/100). If the player chooses "Show results" after multiple rounds of the game, the output should include the player's highest score/%, lowest score/%, and the average score/% of all games played. If the player enters "Q", the program ends.

I know I might use a while loop to repeat the program but I don't know where to place it.

Besides, I have no idea how to output the scores as required in criteria d, I have only managed to set the program to include certain words of encouragement for a designated range of scores.

Lastly, how do I include a fault tolerance function? After inputting the letter "a" into one of the equations, the program just ends. I need a message to prompt the user to input a number.

Any help would be greatly appreciated.
1 month ago