473,799 Members | 3,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Write a program that administers a quiz

I must create ten multiple choice questions.The questions will be weighted
Question1: 10.0 points question2: 15.0 points, etc. Each question has
different weights. The weights must be defined as constants. After the
user enters an answer the program must go to the next question. At the
end of the program I need to output the number of questions answered
correctly, a letter and numerical grade. How do I store the users answer
and calculate the numerical grade? Please Help Asap

Nov 14 '05 #1
5 3386
BabyBoo24 wrote:
I must create ten multiple choice questions.The questions will be weighted
Question1: 10.0 points question2: 15.0 points, etc. Each question has
different weights. The weights must be defined as constants. After the
user enters an answer the program must go to the next question. At the
end of the program I need to output the number of questions answered
correctly, a letter and numerical grade. How do I store the users answer
and calculate the numerical grade? Please Help Asap


First you need to choose your data structure. You'll need one
which can store:
The question
The weight
The real answer
The user's answer
Once you have this, use the C I/O functions to display the
questions, and get the answers. At the end, run through the data
structure and use a comparison function (probably
based on a C string comparison function) to determine if the answer
is correct. Accumulate the number of correct answers and calculate the
numerical grade and letter grade according to the grading formula.

Ajoy

--
www.stanford.edu/~ajoyk
Nov 14 '05 #2
"BabyBoo24" <li*********@ya hoo.com> writes:
I must create ten multiple choice questions.The questions will be weighted
Question1: 10.0 points question2: 15.0 points, etc. Each question has
different weights. The weights must be defined as constants. After the
user enters an answer the program must go to the next question. At the
end of the program I need to output the number of questions answered
correctly, a letter and numerical grade. How do I store the users answer
and calculate the numerical grade? Please Help Asap


If you're not even going to *try* to do this yourself, don't expect
much help here.

You haven't asked a question about the C programming language, which
is what we discuss here.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 14 '05 #3
BabyBoo24 wrote:

I must create ten multiple choice questions.The questions will be
weighted Question1: 10.0 points question2: 15.0 points, etc. Each
question has different weights. The weights must be defined as
constants. After the user enters an answer the program must go
to the next question. At the end of the program I need to output
the number of questions answered correctly, a letter and numerical
grade. How do I store the users answer and calculate the numerical
grade? Please Help Asap


We are happy to do your homework here. We charge USD 200 per
hour. You will have to supply the questions and weights. We can
handle your problem, in portable standard C, with no more than two
hours effort, and will start as soon as we receive your certified
check for $400. Delivery will be made by e-mail within 48 hours of
clearance of your check.

If you supply the e-mail address of your instructor we will also
deliver the result there directly, at no extra charge.

We guarantee the program quality to be such as to deserve an 'A'
marking. However, since your instructor does not report to us, we
cannot guarantee your actually receiving such a mark. We will be
available, at our standard hourly rates plus expenses, to give
testimony should a dispute over your mark arise.

--
"If you want to post a followup via groups.google.c om, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 14 '05 #4
"BabyBoo24" writes:
I must create ten multiple choice questions.The questions will be weighted
Question1: 10.0 points question2: 15.0 points, etc. Each question has
different weights. The weights must be defined as constants. After the
user enters an answer the program must go to the next question. At the
end of the program I need to output the number of questions answered
correctly, a letter and numerical grade. How do I store the users answer
and calculate the numerical grade? Please Help Asap


The assignment isn't specific but from the examples given it sounds as
though the total weight of all the questions is 100. So you would simply
sum the weights of all the correct answers. If this be so and if you had

int sum = 0;

and added to it as appropriate you would end up with the numerical grade.
The number answered correctly would involve a different variable.
Nov 14 '05 #5
BabyBoo24 wrote:
I must create ten multiple choice questions.The questions will be weighted
Question1: 10.0 points question2: 15.0 points, etc. Each question has
different weights. The weights must be defined as constants. After the
user enters an answer the program must go to the next question. At the
end of the program I need to output the number of questions answered
correctly, a letter and numerical grade. How do I store the users answer
and calculate the numerical grade? Please Help Asap


Big Hint: structures.

structure:
Text of question
Weight of question (or value)

Hint: use an array of constant structures.

Hint: use a variable to keep track of the score.

Hint: Talk to instructor first about assignments
before posting here.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
Nov 14 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2650
by: Sketcher | last post by:
Hi, I am trying to create a quiz, Code is as follows: <html> <head> <title>Quiz</title> </head> <BODY> <Center><TABLE cellSpacing=3 cellPadding=0 border=0>
5
5759
by: Vandana Rola | last post by:
Hello Everyone, I am a beginner in Javascript.I want to create fun quiz tool using javascript (no database). The feature of that tool is every question has five choices. The user needs to select three best choices. If they do, a message window pops up which says good choices or something and take them to next question. If they don't choose all of the best choices they get another message like try again but these are not the best choices...
4
7472
by: DAL | last post by:
I want to build my kid a program that cycles through questions (using a label for the question), and lets him choose one of two radio buttons for the right answer. How do I get every set of questions and answers to cycle through until the last question? Also, how can I give him the score after the last question. Thank you in advance. DAL. P.S. As a beginner, I figured I couldn't pass up the chance to learn something new, and to practice...
5
1823
by: ComicCaper | last post by:
Hi all, I use a quiz program that accepts a text file for questions and answers in this format: Question Answer1 <----is the correct answer. Quiz randomizes answers. Answer2 Answer3 Answer4
2
3431
by: kenny | last post by:
I'm making a quiz to be posted on the internet. but I'm facing difficulties in finding a simple timer for the quiz (unlimited timing) which will keep on running regardless to the change of the page throughout the quiz. And well how to display the result of the quiz and te grade of the person who has taken the quiz....
0
4580
NoPeasHear
by: NoPeasHear | last post by:
I don't know what I am doing wrong... I used this tutorial... http://www.permadi.com/tutorial/flashMXQuiz/index.html It works with their quiz.xml file, but when I add an option for multiple correct answers, the results page always gives me a response of 0. What would I change from the tutorial to have multiple correct responses reflect in the results? <?xml version="1.0"?>
3
4407
by: Raqueeb Hassan | last post by:
Hello, I was helping one of my friend's school on setting up a online quiz system. They have the AMP systems to host php+mysql. The quiz script/software should have the following features: a. Excellent results screen (customizable) which can be printed right away. b. 3/5 simultaneously run quizes along with a authentication system. c. Should be able to handle MCQs (multiple choice questions) along with
1
1979
by: bikash607 | last post by:
Dear Expert, i m from very backward place in Bhutan and i need your assistance for a quiz program. I am trying to build a quiz program in Flash 6.0 and if you have any samples, please let me know....i will try my own but i didn't get any idea. Please help and I would remain thankful forever
3
2220
by: empiresolutions | last post by:
I am building a app that creates quizzes. This is how it goes - - Create Quiz - Provide up to 10 different types of Quiz Results - Give up to 50 Questions - Each Question has up to 10 possible Answers. - Each Answer is assigned a Weighted value.... for each type of Quiz Result. - Weighted values are in the range of -6, 0, +6. - Each Quiz will also apply the same Weight range for if a M/F is taking and what of 6 age groups the taker is...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10482
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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...
0
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.