Change your x,y values so that your output looks like the solution.
Click here to see the source for this exercise. If that link shows different source than what you have, then you have an older version of FeetWetCoding and you should download the new version. (Or else the "Click here" link is wrong, if so please let me know at our Forum.)
In this exercise, you will learn:
Why you need to know this:
To do this exercise you need to know:
Change both the x and y parameters.
Throughout fwc, we will talk about coordinates on the screen. A coordinate is the x location and y location, separated by a comma like this: 250,300. That coordinate refers to the location on the screen where x=250 and y=300. That is what we mean when we talk about "x,y" coordinates.
This exercise is similar to the last two, except that now you are changing both the horizontal and vertical position. Go ahead and see if you can change the x and y values to make the exercise visually match the solution. In this case, the x value (the second parameter, after the text string parameter) is 250 and the y value is 300, the third parameter. Remember to close the fwc window before you try to run your program again in Qt Creator.
Notice that changing the x and y parameters is what changes the location on the screen. The numbers in the first parameter "250,300" (which is not a number, but a string of characters) are just the text that you display, and do not control where on the screen something gets drawn. Your program will happily draw "250,300" at the x,y coordinates 99,101 if you only change the x and y parameters, but leave the first parameter, the text string, as "250,300".
If you want to draw a number on the screen (instead of the text string for a number, such as "250") you will need to use a different function that we provide, called fwcDrawInt() which we will get to in a few exercises.
If you get stuck, check the hint link below. When you are done working on this exercise, remember to check the solution code, which lives one directory below your exercise code in the "Solutions" directory, and is in this file:
Always understand the SOLN code before you proceed to the next exercise!
When you are ready, you can proceed to 050_ChangeColorParameter.cpp.