how well did i teach – Intro to Java Programming


To code this in BlueJ, I’ll first imagine just calculating a total for one topic. Let’s say it’s topic two. Now for each student, I want to look at the grade for that student for the current topic. And add it onto the sum so far. This’ll be the sum for this one topic. I’ll initialize sum for topic with zero and then once I’ve calculated it I want to store it in the correct spot for it’s topic. I’ll need to make this array for all of the totals, it contains doubles. And it should have one for each topic, and then at the end, I’ll return all of the totals. But now I need to do this part for all of the topics. So, starting from initializing the sum, to saving it, I want to indent everything, and then add a for loop that goes through all of the topics so now that I am controlling the topic that I am looking at with a for loop we can get rid of that and now I am ready to try it, since there are less topics than students it’s easier to tell this time that it is right, but there are a lot of other ways that we could do this, for example I could create my array with one spot for each topic and I then I could go through each student one student at a time, and add their total. And add their grade to the correct total for the correct topics. And then, for the last line, plus 4 plus 6 plus 5. That might work, too. I think that’s a little more confusing to read. But there could be advantages to that way as well. I think the way that I showed was the simplest. But trying a few different ways is good practice. You could find the one that you like best. What do you like about it?

Leave a Reply

Your email address will not be published. Required fields are marked *