i have been trying to make create this program, it's kinda hard for me to get help in real life because I'm the only computer science student in my second semester.
this is c++. I have to use arrays
I have to make a program that shows grades, based on marks. The number of students depends on the user input.
grade A >=90
grade B >=80
grade C >=70
grade D >=60
grade F <=59
based on the homework my lecturer has given me, the output has to be like this
Enter the number of students: 4
Enter 4 marks: 40 55 70 58
student 0 mark is 40 and grade is C
student 1 mark is 55 and grade is B
student 2 mark is 70 and grade is A
student 3 mark is 58 and grade is B
This is my code:
using namespace std;
cout<<"enter the number of students"<<endl;
cout<<"enter "<<students<<" marks "<<endl;
cout<<"student "<<students<<" mark is "<<mark<<" and grade is "<<grade[x];
I don't know what to do anymore. Help me
The example output shows also that you need two loops:
One to read the user input and store it within the array and another one to print the items.
It is up to you what to store in the array: The mark or the grade. Depending on that the conversion has to be done in the first or second loop. But I would store the mark because that is the data entered by the user and is therefore not lost and can be re-used (e.g. when the next task is extending your program).
Because this is homework, you will not get a final solution here. But you should be able to proceed with my above tips.
Use the debugger to check what part of your code match your expectations and which part don't, it will help you to marrow the search of defects.
When you don't understand what your code is doing or why it does what it does, the answer is debugger.
Use the debugger to see what your code is doing. Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.
The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
The error message is quite clear, so there must be a null parameter somewhere. It may well be inside the actual framework, caused by something not being built correctl. And the only way to find it is by going deep in the debugger.
How do I increase size of my tooltip control as I need to show image to my tooltip I probably need to increase size of my tooltip control?
I tried using Text Renderer Measure Text but it just for increasing size according to text we provide.I want to increase size means height and width of my tool Tip so that my whole image gets displayed. Right now only part of image getting displayed using graphics Draw Image function according default size of tool Tip which is small.I am also providing default size of my image by using Graphics Draw Image function.But since size of my toolTip is small only part of image getting displayed.