I am developing a project that generates questions from a database, the questions are generated with multiple choice answers. On this form I have got a textbox that reds the question from the database and 4 radio buttons that reads the possible answers from the database. The radio buttons text names are updated with records from a database table each time the "next button" is clicked.
What I want this program to do is that when the user selects one of the radio buttons, I want the system to check if the selected radio button textname equals the right answer in the database table. for example in the table there are 5 columns namely: option1, option2, option3, option4 and rightAnswer. So whenever a user selects a radio button, I would like the system to check if the selected radio button's textname equals the record in the "RightAnswer" column and if so I would a messagebox to show "correct" and if not the messgaebox to show "wrong"
This is the the way I am updating the radio button text names from the database This method is called when the form is loaded
void LoadingPossibleAnswers() {
Query = "SELECT * FROM AnswersTbl";
theReader = conn.ExecuteStatement(Query);
while (theReader.Read()) {
radioButton1.Text = theReader["Option1"].ToString();
[code]....
This method is called when the button is clicked
void CorrectAnswer( RadioButton rdb) {
string correct = rdb.Text;
Query = "SELECT * FROM FROM AnswersTbl;"
theReader = conn.ExecuteStatement(Query);
while (theReader.Read())
[code]....
When ever I run my code above, else condition executes even if the correct radio button is selected.
I am working on a website so you can order online for a restaurant. I currently figured out how to get values of all checkboxes and dropdownlists but i still cannot seem to figure out radio buttons.
Right now i am just making a super string with all of the selected values but eventually i am going to want to make a receipt with a checkout page.
//this seems to work alright XPathNodeIterator toppingIterator = myNavigator.Select("//my:ToppersGroup", NamespaceManager); s +=+ ""; while (toppingIterator.MoveNext()) { XPathNavigator node = toppingIterator.Current; XPathNodeIterator children = node.SelectChildren(XPathNodeType.All); while (children.MoveNext())
when user chick first radio button a message1 will show with OK button when user chick second radio button an another message2 will show with OK button
But its didn't work like this. its work like:
1- user chick first radio button 2- message1 will show with OK button 3- user click OK 4- user chick second radio button 5- message1 will show again with OK button 6- user click OK 7- then message2 will show again with OK button
so when user click in second time its show the 2 message the message1 then the message2
How to put together this assignment. Here is the assignment:
The ABC Shipping Company charges the Rates listed in the following table:
Weight of the package (in kilograms) Shipping rate per mile in California Shipping rate per mile other states
2 kg or less $2.0 $2.5
Over2 kg but not more than 6 kg $3.0 $3.5
Over 6 Kg but not more than 10 kg $3.5 $4.0
Over 10 Kg but not more than 30 Kg $4.0 $4.5
Over 30 kg $5.0 $5.5
Create an application that contains two radio buttons to select California or other states, a listbox for the user to select the package’s weight class, a textbox to enter the distance it is to be shipped, and a button to calculate and display the charges on a label control when it is clicked.
Input validation: Do not accept distances of less than 5 miles or more than 3000 miles
This is what I have so far. I don't know how to set up the listbox option for non california or how to set up a formula.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;
I have an existing dialog, having activex control, list control, tree control checkbox, button etc.... I added one radio button and executed the program. whenever i am clicking on the radio button, the dialog hang/crash. Even simply dragging one radio button from toolbox and executing also behaving in the same way.
In my WPF application I created a LINQ to SQL entities class. Then I created a partial class and there add code to my entity class. Below is the code of it:
Then I executed LINQ to SQL. Works perfectly well. Then I bound WPF Datagrid radiobutton column to is_selected property of the partial class. Below is XAML code:
And here I have the problem. When I'm changing the radiobutton status from Unchecked to Checked it doesn't change the value of is_selected property from false to true in the partial class. I don't know why.
I am not getting all the records.... when i select the same date in both datetimepicker no record is displayed... i also want the record of the selected dates from both datetime picker..
work for a radio station as their webmaster, and we have been looking into online streaming options for the last few months for our website. Pretty much everyone charges a monthly fee for this type of service and I feel like it is something I am capable of doing myself.
At the station we have a computer dedicated to operating the music/talk. On this computer there is a program that ques all the music, ads, ect.. This would be my audio source: Either the program playing all the music, or the computer itself.
The problem I have been pondering all night is how would I access this input source? The only audio input I am familiar with accessing is .mp3 or .wav files. How can I code my program to access this audio the program is producing and stream it to people on the web?
My assignment is to write a system for managing a radio station. The code is composed of four classes:
Song: each song has a name, a composer and a singer, and has a few segments: INTRO,VERSE,CHORUS,TRANSITION, while each represents a different length string of chars. Playlist: a multiset of songs, and a pointer to a RadioStatistics instance (see below). RadioStation: a set of Songs (will represent the station database), and a list of Playlists, each playlist holds a few songs from the database. RadioStatistics: can only be instantiate once, this object gather statistics; it has two maps: one that counts how many times a song was played, and second that counts how many times each singer was played. (the key is the song/singer name, and the value is the counter).
The RadioStation has a constant that defines a limit to how many times a song is allowed to be played. whenever a song reaches this limit (meaning, it was played too much), the program needs to skip to the next song in the database.
so, I run this test from main, and the program crashes (or more accuratly get stuck, since the console stays open and the program keeps working until I stop it).
I made a few changes and run the debugger a few times, and was able to focus on the problem.
I ran a step by step debugger, and found out the problem lays with line 90 in RadioManager.cpp, when the while loop runs its fourth iteration. It crashes when it tries to dereference the iterator, while it points to the fourth playlist in the list.
And here's some more weird stuff: when I comment out line 73 in main.cpp - it works perfectly fine! (line 73 in particular! commenting out any other line in main.cpp didn't worked around the bug!)
I've finished my series of tutorials and built a investment calculator with QT, now that's finished and I wanted to create a small radio that allows to retrieve audio from an URL. I wanted to use Juce but I'm clueless about it, I know how to program but I've never touched external libraries?
I have an assignment to write the code for a simulated radio station holding a contest. The contest is for a "caller" (user input obviously) to guess a number from 1 to 500. The "randomly generated" numbers are already chosen and are being stored in a .txt file. The code is to search for number guessed by the caller and if they are wrong, next caller until a caller is correct. The end result is to display the winning number, the indexed location the number was found, and how many callers guessed. This is what I have...
Code: #include<iostream> #include<fstream> using namespace std; int sequenSrch(const int prizeArray[], int arrayLength, int searchedItem); int guess();
[Code] ....
I'm not sure if I am even on the right track... when I pass something into the sequenSrh(); the code compiles, asks for the number to be guessed and ends.
I have a secnario where I have few tab controls one ineide the other, where my real tab pages containing the data are 4 level deep. This entire structure is dynamically built from a data base.
Now I have a tick event, on whice I want to update the data in the currently selected tabpage.
How can I find it, recall that I have many tab controls, each has a tabpage with another tab control an so forth...
Two ideas I had in mind, I though I caould generate a list of all my data TabPages and itterate it, but I failed to find an indicator of the selected tab.
Another idea was to track the currently selected tabpage via an event, but I feared that I might miss somehow the track and my update the wrong tab page.
Last idea was really unelegant - Look at the main control, get the selected tab page, find the tab control on that page via searching its controls, than find this control selected page, and do the same until I reach the 4th level.
I'm trying to find an event for the combobox when its selected value changes , but I can't seem to find the right one since I've tried several events in the dataGridView that are just triggering at the wrong moments. I need to remove the selected item from that combobox so that it doesn't get selected again at the second combobox which usually have the same items .
when we click on a line in text area I want to open a popup having all text from that line. I should be able to select some of its text then if I click on save button of popup then only selected text should be saved and displayed in original text area of form. I want to use this for multiple sentences of text area.
I'm trying to build an app, but i don't know which is the best language choice. For starters, the app should be able to:
1. run from context menu 2. when selecting some text from a web browser (ff, ie), that text is captured (preferably not in clipboard) and sent as argument to the program via context menu and the program starts executing...
IF statement. Really new, so this will be simple I'm sure. I'm essentially just trying to roll a 6 and 20 sided die. I want the statement to run "If 20,then display the randomly selected number for 20".
// auto dice roller #include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std;