473,659 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Highest and Lowest scores of a series of test taken, if the test could be taken as ma

2 New Member
I was asked to create a C++ program that allows a user to take a test with series of different questions, and also retake the test if they choose to. I have been able to do that. But the other condition is to display the highest and lowest scores (highest and lowest correct answers) the user got, and in which test they got that score. For example, if the user takes the test 3 times, in which test did they get the highest score, and in which did they get the lowest score. I haven't learnt array yet, so it isn't an option for now. Thanks a lot.

This is how far I went with the program. The code below only let the user take the test as much as they want, and tell them how many times they took it, and the last score they had. My idea is this, if I can make a variable store each test score, then I can compare them. But since there is no definite number of tests to be taken, I think I'ld need a loop. Please help.



Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. void main()
  6. {
  7.        int correct = 0;
  8.        int wrong = 0;
  9.        int count = 0;
  10.        string choice;
  11.        string ans;
  12.        cout << "\t\t\t Principles of Macroeconomics (ECO 201)\n";
  13.        cout << "\t\t\t****************************************\n";
  14.        cout << "\t\t\t\t\t Test Exam\n";
  15.        cout << "\t\t\t\t\t***********\n\n\n";
  16.        while (true)
  17.        {
  18.                while (true)
  19.                {
  20.                        cout << "Multiple Choice: 2 points each\n\n";
  21.                        cout << "Enter each answer using a....e\n\n";
  22.                        cout << "1. In economics, choices are necessary because of the presence of:\n";
  23.                        cout << "\ta. luxuries\n";
  24.                        cout << "\tb. inefficiency\n";
  25.                        cout << "\tc. needs\n";
  26.                        cout << "\td. scarcity\n";
  27.                        cout << "\te. incentives\n";
  28.                        cout << "Answer: ";
  29.                        cin >> choice;
  30.                        if (choice == "d")
  31.                        {
  32.                                correct++;
  33.                                cout << "Correct: Scarcity\n\n\n";
  34.                                break;
  35.                        }
  36.                        else
  37.                                if ((choice >= "a" && choice <= "c") || (choice >= "e" && choice <= "e"))
  38.                                {
  39.                                wrong++;
  40.                                cout << "\aWrong!!!\n\n\n";
  41.                                break;
  42.                                }
  43.                                else
  44.                                        if ((choice >= "f" || choice <= "z"))
  45.                                        {
  46.                                cout << "Wrong input! Your input is out of range!\n\n";
  47.                                cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  48.                                cin >> ans;
  49.                                if (ans == "n")
  50.                                {
  51.                                        break;
  52.                                }
  53.                                        }
  54.                }
  55.  
  56.  
  57.                while (true)
  58.                {
  59.                                cout << "2. Assumptions are necessary to build a good economic model\n";
  60.                                cout << "\ta. True\n";
  61.                                cout << "\tb. False\n";
  62.                                cout << "Answer: ";
  63.                                cin >> choice;
  64.                                if (choice == "a" || choice == "true")
  65.                                {
  66.                                        correct++;
  67.                                        cout << "True: Assumptions are necessary to build a good economic model\n\n\n";
  68.                                        break;
  69.                                }
  70.                                else
  71.                                        if (choice == "b" || choice == "false")
  72.                                {
  73.                                        wrong++;
  74.                                        cout << "\aWrong!!!\n\n\n";
  75.                                        break;
  76.                                }
  77.                                        else
  78.                                                if ((choice >= "c" || choice <= "z"))
  79.                                                {
  80.                                        cout << "Wrong input! Your input is out of range!\n\n";
  81.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  82.                                        cin >> ans;
  83.                                        if (ans == "n")
  84.                                        {
  85.                                                break;
  86.                                        }
  87.                                                }
  88.                }
  89.  
  90.  
  91.  
  92.                while (true)
  93.                {
  94.                                cout << "3. Economics is the study of: \n";
  95.                                cout << "\ta. how to make money\n";
  96.                                cout << "\tb. how to allocate resources to satisfy wants and needs\n";
  97.                                cout << "\tc. capitalism\n";
  98.                                cout << "\td. how to make workers more productive and firms more profitable\n";
  99.                                cout << "\te. markets\n";
  100.                                cout << "Answer: ";
  101.                                cin >> choice;
  102.                                if (choice == "b")
  103.                                {
  104.                                        correct++;
  105.                                        cout << "Correct: How to allocate resources to satisfy wants and needs\n\n\n";
  106.                                        break;
  107.                                }
  108.                                else
  109.                                        if ((choice >= "a" && choice <= "a") || (choice >= "c" && choice <= "e"))
  110.                                {
  111.                                        wrong++;
  112.                                        cout << "\aWrong!!!\n\n\n";
  113.                                        break;
  114.                                }
  115.                                        else
  116.                                                if ((choice >= "f" || choice <= "z"))
  117.                                                {
  118.                                        cout << "Wrong input! Your input is out of range!\n\n";
  119.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  120.                                        cin >> ans;
  121.                                        if (ans == "n")
  122.                                        {
  123.                                                break;
  124.                                        }
  125.                                                }
  126.                }
  127.  
  128.  
  129.  
  130.  
  131.                while (true)
  132.                {
  133.                                cout << "4. Which of the following is true?\n";
  134.                                cout << "\ta. unaccounted variables in a model are called endogenous factors\n";
  135.                                cout << "\tb. unaccounted variables in a model are called exogenous factors\n";
  136.                                cout << "Answer: ";
  137.                                cin >> choice;
  138.                                if (choice == "b")
  139.                                {
  140.                                        correct++;
  141.                                        cout << "Correct: Unaccounted variables in a model are called exogenous factors\n\n\n";
  142.                                        break;
  143.                                }
  144.                                else
  145.                                        if ((choice >= "a" && choice <= "a") || (choice >= "c" && choice <= "e"))
  146.                                {
  147.                                        wrong++;
  148.                                        cout << "\aWrong!!!\n\n\n";
  149.                                        break;
  150.                                }
  151.                                        else
  152.                                                if ((choice >= "f" || choice <= "z"))
  153.                                                {
  154.                                        cout << "Wrong input! Your input is out of range!\n\n";
  155.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  156.                                        cin >> ans;
  157.                                        if (ans == "n")
  158.                                        {
  159.                                                break;
  160.                                        }
  161.                                                }
  162.                }
  163.  
  164.  
  165.  
  166.                while (true)
  167.                {
  168.                                cout << "5. Ceteris paribus means: \n";
  169.                                cout << "\ta. in sets of two\n";
  170.                                cout << "\tb. constant opportunity cost\n";
  171.                                cout << "\tc. other things being equal\n";
  172.                                cout << "\td. buyer beware\n";
  173.                                cout << "\te. there is no reason to argue about people's tastes\n";
  174.                                cout << "Answer: ";
  175.                                cin >> choice;
  176.                                if (choice == "c")
  177.                                {
  178.                                        correct++;
  179.                                        cout << "Correct: Other things being equal\n\n\n";
  180.                                        break;
  181.                                }
  182.                                else
  183.                                        if ((choice >= "a" && choice <= "b") || (choice >= "d" && choice <= "e"))
  184.                                {
  185.                                        wrong++;
  186.                                        cout << "\aWrong!!!\n\n\n";
  187.                                        break;
  188.                                }
  189.                                        else
  190.                                                if ((choice >= "f" || choice <= "z"))
  191.                                                {
  192.                                        cout << "Wrong input! Your input is out of range!\n\n";
  193.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  194.                                        cin >> ans;
  195.                                        if (ans == "n")
  196.                                        {
  197.                                                break;
  198.                                        }
  199.                                                }
  200.                }
  201.  
  202.  
  203.  
  204.  
  205.                while (true)
  206.                {
  207.                                cout << "6. Which of the following is a true normative statement?\n";
  208.                                cout << "\ta. we should strive to push the PPF outward\n";
  209.                                cout << "\tb. points on the production possiblities frontier (PPF) are efficient\n";
  210.                                cout << "Answer: ";
  211.                                cin >> choice;
  212.                                if (choice == "a")
  213.                                {
  214.                                        correct++;
  215.                                        cout << "Correct: We should strive to push the PPF outward\n\n\n";
  216.                                        break;
  217.                                }
  218.                                else
  219.                                        if (choice >= "b" && choice <= "e")
  220.                                {
  221.                                        wrong++;
  222.                                        cout << "\aWrong!!!\n\n\n";
  223.                                        break;
  224.                                }
  225.                                        else
  226.                                                if ((choice >= "f" || choice <= "z"))
  227.                                                {
  228.                                        cout << "Wrong input! Your input is out of range!\n\n";
  229.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  230.                                        cin >> ans;
  231.                                        if (ans == "n")
  232.                                        {
  233.                                                break;
  234.                                        }
  235.                                                }
  236.                }
  237.  
  238.  
  239.  
  240.                while (true)
  241.                {
  242.                                cout << "7. Which of the following is a positive statement?\n";
  243.                                cout << "\ta. an economist should test every theory at least twice\n";
  244.                                cout << "\tb. increases in the minimum wage cause unemployment\n";
  245.                                cout << "\tc. we ought to deregulate the mortgage market\n";
  246.                                cout << "\td. the government must provide unlimited health care to citizens\n";
  247.                                cout << "\te. we should forgo some current consumption for a better future\n";
  248.                                cout << "Answer: ";
  249.                                cin >> choice;
  250.                                if (choice == "b")
  251.                                {
  252.                                        correct++;
  253.                                        cout << "Correct: increases in the minimum wage cause unemployment\n\n\n";
  254.                                        break;
  255.                                }
  256.                                else
  257.                                        if ((choice >= "a" && choice <= "a") || (choice >= "c" && choice <= "e"))
  258.                                {
  259.                                        wrong++;
  260.                                        cout << "\aWrong!!!\n\n\n";
  261.                                        break;
  262.                                }
  263.                                        else
  264.                                                if ((choice >= "f" || choice <= "z"))
  265.                                                {
  266.                                        cout << "Wrong input! Your input is out of range!\n\n";
  267.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  268.                                        cin >> ans;
  269.                                        if (ans == "n")
  270.                                        {
  271.                                                break;
  272.                                        }
  273.                                                }
  274.                }
  275.  
  276.  
  277.  
  278.                while (true)
  279.                {
  280.                                cout << "8. The world is the laboratory of the economist\n";
  281.                                cout << "\ta. true\n";
  282.                                cout << "\tb. false\n";
  283.                                cout << "Answer: ";
  284.                                cin >> choice;
  285.                                if (choice == "a")
  286.                                {
  287.                                        correct++;
  288.                                        cout << "Correct: The world is the laboratory of the economist\n\n\n";
  289.                                        break;
  290.                                }
  291.                                else
  292.                                        if (choice >= "b" && choice <= "e")
  293.                                {
  294.                                        wrong++;
  295.                                        cout << "\aWrong!!!\n\n\n";
  296.                                        break;
  297.                                }
  298.                                        else
  299.                                                if ((choice >= "f" || choice <= "z"))
  300.                                                {
  301.                                        cout << "Wrong input! Your input is out of range!\n\n";
  302.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  303.                                        cin >> ans;
  304.                                        if (ans == "n")
  305.                                        {
  306.                                                break;
  307.                                        }
  308.                                                }
  309.                }
  310.  
  311.  
  312.  
  313.                while (true)
  314.                {
  315.                                cout << "9. A positive statement: \n";
  316.                                cout << "\ta. is a claim that can be tested\n";
  317.                                cout << "\tb. is a statement about what ought to be\n";
  318.                                cout << "\tc. is a declaration of opinion\n";
  319.                                cout << "\td. is a claim that cannot be tested\n";
  320.                                cout << "\te. cannot be evaluated using the scientific method\n";
  321.                                cout << "Answer: ";
  322.                                cin >> choice;
  323.                                if (choice == "a")
  324.                                {
  325.                                        correct++;
  326.                                        cout << "Correct: Is a claim that can be tested\n\n\n";
  327.                                        break;
  328.                                }
  329.                                else
  330.                                        if (choice >= "b" && choice <= "e")
  331.                                {
  332.                                        wrong++;
  333.                                        cout << "\aWrong!!!\n\n\n";
  334.                                        break;
  335.                                }
  336.                                        else
  337.                                                if ((choice >= "f" || choice <= "z"))
  338.                                                {
  339.                                        cout << "Wrong input! Your input is out of range!\n\n";
  340.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  341.                                        cin >> ans;
  342.                                        if (ans == "n")
  343.                                        {
  344.                                                break;
  345.                                        }
  346.                                                }
  347.                }
  348.  
  349.  
  350.  
  351.  
  352.                while (true)
  353.                {
  354.                                cout << "10. Because of scarcity individuals/society must always make a choice\n";
  355.                                cout << "\ta. True\n";
  356.                                cout << "\tb. False\n";
  357.                                cout << "Answer: ";
  358.                                cin >> choice;
  359.                                if (choice == "a")
  360.                                {
  361.                                        correct++;
  362.                                        cout << "Correct: True\n\n\n";
  363.                                        break;
  364.                                }
  365.                                else
  366.                                        if (choice <= "b" && choice <= "e")
  367.                                {
  368.                                        wrong++;
  369.                                        cout << "\aWrong!!!\n\n\n";
  370.                                        break;
  371.                                }
  372.                                        else
  373.                                                if ((choice >= "f" || choice <= "z"))
  374.                                                {
  375.                                        cout << "Wrong input! Your input is out of range!\n\n";
  376.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  377.                                        cin >> ans;
  378.                                        if (ans == "n")
  379.                                        {
  380.                                                break;
  381.                                        }
  382.                                                }
  383.                }
  384.  
  385.  
  386.  
  387.  
  388.                while (true)
  389.                {
  390.                                cout << "11. A good is ______ if it takes even time, energy, or money to acquire\n";
  391.                                cout << "\ta. abundant\n";
  392.                                cout << "\tb. in shortage\n";
  393.                                cout << "\tc. cheap\n";
  394.                                cout << "\td. scarce\n";
  395.                                cout << "\te. virtually free\n";
  396.                                cout << "Answer: ";
  397.                                cin >> choice;
  398.                                if (choice == "d")
  399.                                {
  400.                                        correct++;
  401.                                        cout << "Correct: Scarce\n\n\n";
  402.                                        break;
  403.                                }
  404.                                else
  405.                                        if ((choice >= "a" && choice <= "c") || (choice >= "e" && choice <= "e"))
  406.                                {
  407.                                        wrong++;
  408.                                        cout << "\aWrong!!!\n\n\n";
  409.                                        break;
  410.                                }
  411.                                        else
  412.                                                if ((choice >= "f" || choice <= "z"))
  413.                                                {
  414.                                        cout << "Wrong input! Your input is out of range!\n\n";
  415.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  416.                                        cin >> ans;
  417.                                        if (ans == "n")
  418.                                        {
  419.                                                break;
  420.                                        }
  421.                                                }
  422.                }
  423.  
  424.  
  425.  
  426.  
  427.                while (true)
  428.                {
  429.                                cout << "12. Increase in government involvement failed Thomas Malthus's prediction\n";
  430.                                cout << "\ta. True\n";
  431.                                cout << "\tb. False\n";
  432.                                cout << "Answer: ";
  433.                                cin >> choice;
  434.                                if (choice == "b")
  435.                                {
  436.                                        correct++;
  437.                                        cout << "Correct: False\n\n\n";
  438.                                        break;
  439.                                }
  440.                                else
  441.                                        if ((choice >= "a" && choice <= "a") || (choice >= "c" && choice <= "e"))
  442.                                {
  443.                                        wrong++;
  444.                                        cout << "\aWrong!!!\n\n\n";
  445.                                        break;
  446.                                }
  447.                                        else
  448.                                                if ((choice >= "f" || choice <= "z"))
  449.                                                {
  450.                                        cout << "Wrong input! Your input is out of range!\n\n";
  451.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  452.                                        cin >> ans;
  453.                                        if (ans == "n")
  454.                                        {
  455.                                                break;
  456.                                        }
  457.                                                }
  458.                }
  459.  
  460.  
  461.  
  462.                while (true)
  463.                {
  464.                                cout << "13. Why do economists use models?\n";
  465.                                cout << "\ta. models are used to add complexity to a simple world\n";
  466.                                cout << "\tb. models allow us to study a simplified version of a complex world\n";
  467.                                cout << "\tc. models allow us to control exogenous factors\n";
  468.                                cout << "\td. models make the world harder to understand\n";
  469.                                cout << "\te. models allow us to examine more factors even beyond our world\n";
  470.                                cout << "Answer: ";
  471.                                cin >> choice;
  472.                                if (choice == "b")
  473.                                {
  474.                                        correct++;
  475.                                        cout << "Correct: models are used to add complexity to a simple world\n\n\n";
  476.                                        break;
  477.                                }
  478.                                else
  479.                                        if ((choice >= "a" && choice <= "a") || (choice >= "c" && choice <= "e"))
  480.                                {
  481.                                        wrong++;
  482.                                        cout << "\aWrong!!!\n\n\n";
  483.                                        break;
  484.                                }
  485.                                        else
  486.                                                if ((choice >= "f" || choice <= "z"))
  487.                                                {
  488.                                        cout << "Wrong input! Your input is out of range!\n\n";
  489.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  490.                                        cin >> ans;
  491.                                        if (ans == "n")
  492.                                        {
  493.                                                break;
  494.                                        }
  495.                                                }
  496.                }
  497.  
  498.  
  499.  
  500.  
  501.                while (true)
  502.                {
  503.                                cout << "14. Trade-off and opportunity cost are one and the same thing\n";
  504.                                cout << "\ta. True\n";
  505.                                cout << "\tb. False\n";
  506.                                cout << "Answer: ";
  507.                                cin >> choice;
  508.                                if (choice == "b")
  509.                                {
  510.                                        correct++;
  511.                                        cout << "Correct: False\n\n\n";
  512.                                        break;
  513.                                }
  514.                                else
  515.                                        if ((choice >= "a" && choice <= "a") || (choice >= "c" && choice <= "e"))
  516.                                {
  517.                                        wrong++;
  518.                                        cout << "\aWrong!!!\n\n\n";
  519.                                        break;
  520.                                }
  521.                                        else
  522.                                                if ((choice >= "f" || choice <= "z"))
  523.                                                {
  524.                                        cout << "Wrong input! Your input is out of range!\n\n";
  525.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  526.                                        cin >> ans;
  527.                                        if (ans == "n")
  528.                                        {
  529.                                                break;
  530.                                        }
  531.                                                }
  532.                }
  533.  
  534.  
  535.  
  536.  
  537.                while (true)
  538.                {
  539.                                cout << "15. The basic goal of economics is: \n";
  540.                                cout << "\ta. controlling the effects of government actions\n";
  541.                                cout << "\tb. determine how to distribute all that is produced in an economy\n";
  542.                                cout << "\tc. addressing scarcity problem created by population's desire\n";
  543.                                cout << "\td. matching limited resources to people's limited wants and needs\n";
  544.                                cout << "\te. controlling tastes and wishes to produce resources that meets wants\n";
  545.                                cout << "Answer: ";
  546.                                cin >> choice;
  547.                                if (choice == "c")
  548.                                {
  549.                                        correct++;
  550.                                        cout << "Correct: Addressing scarcity problem created by population's desire\n\n\n";
  551.                                        break;
  552.                                }
  553.                                else
  554.                                        if ((choice >= "a" && choice <= "b") || (choice >= "d" && choice <= "e"))
  555.                                {
  556.                                        wrong++;
  557.                                        cout << "\aWrong!!!\n\n\n";
  558.                                        break;
  559.                                }
  560.                                        else
  561.                                                if ((choice >= "f" || choice <= "z"))
  562.                                                {
  563.                                        cout << "Wrong input! Your input is out of range!\n\n";
  564.                                        cout << "Do you want to try again?\n\nEnter any letter to continue or \"n\" to exit the program\n";
  565.                                        cin >> ans;
  566.                                        if (ans == "n")
  567.                                        {
  568.                                                break;
  569.                                        }
  570.                                                }
  571.                }
  572.  
  573.  
  574.  
  575.                                cout << "You answered " << correct << " out of 15 questions correctly\n";
  576.                                cout << "You got " << wrong << " answers wrong\n";
  577.                                if (correct < 7)
  578.                                {
  579.                                        cout << "Your grade is poor\n\n";
  580.                                }
  581.                                else
  582.                                        if (correct >= 7 && correct <= 10)
  583.                                        {
  584.                                        cout << "Your grade is fair\n\n";
  585.                                        }
  586.                                        else
  587.                                        {
  588.                                                cout << "Your grade is good\n\n";
  589.                                        }
  590.  
  591.                                count++;
  592.                                cout << "Do you want to take the test again? ";
  593.                                cin >> ans;
  594.                                if (ans == "no" || ans == "n")
  595.                                {
  596.                                        break;
  597.                                }
  598.                                else
  599.                                {
  600.                                        correct = 0;
  601.                                        wrong = 0;
  602.                                }
  603.                                        }
  604.                        cout << "You took the test " << count << " times\n";
  605.                        system("PAUSE");
  606.                }
Oct 22 '14 #1
3 1415
Banfa
9,065 Recognized Expert Moderator Expert
First void main() is wrong, in C++ main always ... ALWAYS ... returns int. If your compiler is accepting this it is a non-conformant compiler.

For what you want to do, store the score of each test and compare at the end you would need to use an array (or preferably vector) which you say you haven't learnt yet and can't use.

There is an alternative using 2 integers to store the test number with the most correct answers and the number of answers that where correct for that test. Initialise both values to 0 and then at the end of each test iteration compare the number of correct answers for that test iteration with the number of correct answers for the best test so far and if it is greater update the 2 variables.

Expand|Select|Wrap|Line Numbers
  1. int best_test = 0;
  2. int best_test_score = 0;
  3.  
  4. while(...)
  5. {
  6.   ...
  7.  
  8.   if (score > best_test_score)
  9.   {
  10.     best_test = count;
  11.     best_test_score = score;
  12.   }
  13. }
  14.  
Oct 22 '14 #2
Perewari
2 New Member
Thanks. I understand you. But my question is this: if we now have the variables, what will be the loop condition, and the body, for it to be able to recognize either high or low?
Oct 22 '14 #3
Banfa
9,065 Recognized Expert Moderator Expert
Loop condition and body remain the same as your original code
Oct 22 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2087
by: MLH | last post by:
DELETE test.name FROM test WHERE (((test.name) Like "o*")); I use MS Access. The above SQL is OK with Access, but not with MySQL. Other than the semicolon at the end of the phrase, what's wrong with my syntax? The following work... SELECT DISTINCTROW test.name FROM test SELECT ALL test.name FROM test
8
3071
by: starman7 | last post by:
i have a table with objects in categories and their positions. there will be several rows with category 400, and they will have various positions, i want to delete only the row with the lowest position. i can select the row i want to delete, but don't know how to delete just this row. here's my select:
3
4742
by: Akinyemi | last post by:
I am writing a Visual Basic program for calculating students scores, and also grading the highest 3 scores as "First" , "Second" and "Third" respectively. I have been able to get the program to compute the score of each student. I have not been able to grade the highest three scores into First, second and third. Kindly assist me, please.
4
2919
by: tomek milewski | last post by:
Hello, I have a map with keys that can be compared each other. I need a method that returns the lowest and the greatest key from that map. Now I'm using begin() and rbegin() which gives iterators to first and last element of the map. My question is: Does begin() and rbegin() guarantee that returned iterators point on the pair with lowest and gratest value?
176
8334
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write their own unit test framework, and then in a lab session see if I can get them to write their own. To give them an example I've created the following UTF class (with a simple test program following). I would welcome and suggestions on how anybody...
0
1721
by: =?Utf-8?B?TU9QU0M=?= | last post by:
Hi, i'm having a problem and hoping someone can give me some insight. I have Server Enterprise 2008 installed, set to a file server role with FSRM installed. I'm trying to setup where it will notify me when a user is over the limit but it seems to be having a problem. Even to the point of a test msg being sent. I have it pointed to our exchange (2003) server for the smtp server, but when i click "Send Test Email" it locks up for about...
1
8151
by: niner | last post by:
I have been working on the following code for about 6 hours now. I am attempting to write a program in Java that finds the highest, lowest, sum, and mean of an array. The program should also end inputs with the input of "0." I have figured out how to do the sum, mean, highest, lowest. The issue I'm having is to get the array count and to make it exit on "0." Is there a way to have the array variable outside the do/while control statement that...
1
1666
by: Kris tarun | last post by:
I have a table of a retail store which has almost 13000 customers. and i want to write a query for this.. Group products based on their sales patterns. Highest, lowest, and median values. Use sale prices as an indicator as well (Do these products sell well only when they are discounted?). it also uses clustering.i dont know what to do Thanks a ton !!!
2
1283
by: cliffs | last post by:
I have the following the data in access 2003 database. sr No. high low pline dline basetype zonetype 1 1146 1142 1124 1126 1 1 2 1136 1134 1128 1126 1 2 3 1137 1130 1129 1125 1 2 4 1147 1139 1131 1134 1 2 5 1131 1128 1128 1130 1 1 ...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.