C# :: Multiple Choice Symptom Checker?
Mar 9, 2015
I'm doing a project through college which is a diagnostic and support tool for Windows OS's. The application at the moment has a simple expert system which is a Combobox with strings that relate to common PC problems. Then those strings are put through a switch statement and relevant commands are shown to fix the problem i.e. "My printer is not working" will disable all buttons except for printer management, spooler folder etc.
My supervisor who marks my project has said this isnt good enough and wants a more layered hierarchy approach so he's looking for 3-4 groupboxes with tickboxes inside them and users tick the boxes that relate to their problem which will give the functions to support. The only way I can see to do this at the moment is a massive nested switch statement that is really not worth the time. There are 60+ functions in my program so you can imagine how long the switch would be trying to pick and iterate through all of the possible answers.
I'm just trying to figuire out an easier way to do this, rather than a massive switch statement. Something like WebMD which has 4-5 tick boxes and can give out the same answer for different symptoms.
I've attached a Flow Chart I made of the hierarchy Im trying to go for [URL] .....
View 1 Replies
ADVERTISEMENT
Feb 20, 2012
I have gotten my code sorted out, and now it works. But to be adaptable to 3pi robots, which I will be loading it into eventually, the user has to be given three letter (a, b, c) multiple choices for answer input to the math questions. The three choices have to be randomized everytime the program loops too. Currently it just runs on number input.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
int menu();
void addition(int *Preward); // function to return truth values
void subtraction(int *Preward);
[Code] ....
View 4 Replies
View Related
Oct 29, 2014
I tried to create a multiple choice list and I want to assign the value of the answer option chosen by the user so I can use it later on in the code. Later on in the code i've asked how many people (p) want a drink and multiplied it by the chosen size to calculate the price c = p * n where c is cost, n is price and p is number o of people At the bottom i tried to assign parameters where depending on what option the user has chosen n will be assigned to the chosen value...
{
printf("SELECT TYPE OF PAINT:"); /*multiple choice of paint */
printf("1. Large ");
[Code]....
View 1 Replies
View Related
Feb 20, 2012
I have a multiple choice function below that is part of a larger program but I am having trouble having it operate with characters as inputs and arguments. It has to be a character input, but I kinda want it to act like an integer, how do i do that?
Code:
void addition(int *Preward) //function that is called by the users selection {
int random1, random2;
int order;
int one, two, three;
int rando1, rando2;
char a, b, c; // ERROR
[Code] ....
View 2 Replies
View Related
Apr 10, 2013
I am trying to create a multiple choice quiz so I can learn the menu at my new job, while doing a side project but I am having a warning when outputting. Speaking of side projects, is this a kind of side project people are looking for on a resume?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
}
[code]....
View 8 Replies
View Related
Nov 4, 2013
I am writing a program for grading a multiple choice test. The test data is pulled in from another file. My problem is that its only pulling in the first line of data and running an infinite loop without reading the next line of the data file.
My code is as follows:
PrintPurpose ( );
cout << student << " ";
cout << answers << " ";
inData >> key;
[Code].....
View 1 Replies
View Related
Jan 7, 2015
So im trying to create a quiz using c++ that incorporates three different types of questions. These are the standard one answer question, true false questions and multiple choice questions.
How to create the true false and multiple choice questions?
One way that i came up with looks like this
Question A answer1 B answer2;
View 2 Replies
View Related
Jul 22, 2014
I'm making a text editor for my own programming language and I wanna make a simple software updater for it.
View 4 Replies
View Related
Nov 21, 2012
A student approached me and asked why his prime checker wouldn't work. I took a look and it should work, imo, for all < 64 bit inputs.
Code:
int isitprime(unsigned long long in) {
unsigned long long c;
unsigned long long max = sqrt(in);
if(in <= 1 )
[Code] .....
checked for a bunch of primes i could think of 0,1,2,3,4,5,6,7 up to 18446744073709551557, which is supposed to be one of the largest 64 bit primes. Worked.
View 5 Replies
View Related
Mar 7, 2015
I am programming a simple spell checker which checks if words match in a given dictionary.
The user first enters the words from the dictionary and then the words to check. I have comments in my code that explain how this is done.
The catch for the checking is: I cannot use functions like strcmp or even functions I made myself. For input and output I will also only use getchar and putchar.
Where I am stuck: I have a concept of how to check and compare the words with the dictionary, but this way the looping is extremely confusing (at least in my mind) and I cannot make a functioning one. The concept for this is in the comments of the code.
Here is what I've got so far.
The user enters aaa bb bbaa;abc aaa aa.
The output should be: *abc* aaa *aa*.
Since abc and aa does not match the dictionary on the left, but aaa does.
Also, words can have a max length of 4.
#include <stdio.h>
int main() {
char dictionary[40];
char words[40];
char both[80];
[Code] .....
View 6 Replies
View Related
Nov 30, 2014
I have this piece of code from the book "Modern C++ Design" that checks for compile-time error. When i tried to compile it, i get the error "invalid application of size of to function type". How to make this compiler-time checker work?
Code:
template<bool> struct CompileTimeChecker{
CompileTimeChecker(...);
};
template<> struct CompileTimeChecker<false> {};
[Code] .....
View 4 Replies
View Related
Jul 31, 2013
Over the last few days, I've been trying to implement a spell checker in c++ that checks if the inputted word is in the dictionary file on my computer. However, as I'm nearing completion of the project, I keep running into more and more errors, some of which I do not understand. My program is complete, albeit, with some minor bad practices (I hard coded a few things just to get the program up and running.For some reason, everything works well until I output spelling suggestions. I type in "mses" (attempting to spell mess) and it returns some strange characters. It does definitely recognize that there are two permutations that match words in the dictionary (however they are both mess due to the algorithm implemented), and I don't understand why? I will work on removing the duplicates after.
// Spell Checker.cpp : Defines the entry point for the console application.//
#include "stdafx.h"
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <iostream>
[Code] .....
View 7 Replies
View Related
Sep 25, 2013
How do you read an int choice in with a string buffer instead of cin?
View 2 Replies
View Related
Nov 11, 2014
Im trying to create something like a menu in a tic tac toe game. I want the computer to ask the user "who starts first" is it the X or the O who starts first? Then the user should type in either X or O but if he types something else i want to ask again .
this is what ive done :
int main () {
printf("
");printf("
");
printf(" %c | %c | %c
", board[1], board[2], board[3]);
[Code] .....
View 10 Replies
View Related
Jun 1, 2013
I just recently finished up a program that implements Dijkstra's Algorithm and I thought I would make a nice little menu for the user.
so the user can input their locations, I use Getline just in case their location contains spaces. However, when the user selects 2, It skips over the first input for the "Source" location and only lets the user input for the "Destination".
Any reason why this would happen? Am I missing something with Getline? Anyway, here's the code...
template <typename V, typename E>
void Graph<V, E>::Driver() {
bool done = false;
int menu(0);
InputFile();
[Code] ......
View 2 Replies
View Related
Feb 23, 2014
#include <stdio.h>
#include <stdlib.h>
int n;
int m;
char input[20];
int num;
int main() {
int num0;
[code]....
I'm supposed to write C program that will generate a 5 X 5 multiplication table starting with the number of the users choice. The program is supposed to operate within a loop and run until the user indicates that they no longer wish to enter any more numbers. I can get the program to run but am wondering what I need to do to get the program to ask for another number and how to make the program stop when the user no longer wants to play. Should I start with "Do you want to enter a number" if yes, run back through loop if no, goodbye?
View 8 Replies
View Related
Feb 17, 2012
Below is a program that generates random Addition for Subtraction problems depending on the user's choice. The user is prompted to input an answer and then it keeps your score. If you want to quit you just press zero.
Code:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iomanip>
#include <string>
using namespace std;
int menu();
bool addition(int &reward); // function to return truth values
[Code] ....
View 14 Replies
View Related
Dec 7, 2013
I'm new to c i've been trying to write code everyday, and recently ive been reading a book and decided to write my own program with what ive learned with it, basicly you get a choice for how many different main courses you would like to have (right now you can only choose 1) and then you can choose which course you would like, it then asks for the amount of guests you would like and calculates how much food you will need to feed the guests. My code compiles but the program doesn't work properly
Code:
#include<stdio.h>
float guests;
float lbs;
int guest_att(guests)
{
puts("how many guests will be attending?");
scanf("%d",& guests);
[Code] .....
and this is how the program runs
Code:
Scotts-MacBook-Pro:learnc scott$ ./wed
how many main course choices will you have?
1
Please make a selection.
1. Chicken
2. Fish
3. Steak
invalid choice
Please make a selection.
1. Chicken
2. Fish
3. Steak
1
how many guests will be attending? 55
You need 0.000000 pounds of of chicken
Please make a selection.
1. Chicken
2. Fish
3. Steak
invalid choice
Please make a selection.
1. Chicken
2. Fish
3. Steak
View 3 Replies
View Related
Jul 31, 2014
I want to develop an application which can host multiple views of explorer (window), where as each window is totally separate from others. So that I can have multiple desktop views through my single explorer. Any built in feature in .NET ?
View 11 Replies
View Related
Aug 17, 2014
how to make subroutines and return multiple arrays.Before that, i wrote my program on matlab. could my program to be structured as following?
<header>
initial value of program;
subroutine1() {
calculating the first work;
return 2 or 3 arrays;
[code].....
View 14 Replies
View Related
Mar 21, 2014
I've been working on a function that works like a pipeline of a shell but receives a directory, go over it an search for every file to send it to a filter, something like this in bash "cat dir/* | cmd_1 | cmd_2 | ... | cmd_N", The only problem i have with the code is the redirection of the pipe descriptors.
Code:
int main(int argc, char* argv[]){
char** cmd;
int Number_cmd;
cmd = &(argv[2]); /*list of cmds*/
Number_cmd = argc-2; /*number of cmds*/
}
[code]....
The code is seems to work fine except when i run it with more than one command in example ("./filter DIR wc rev") in this case it returns
wc: standard input: Bad file descriptor
wc: -: Bad file descriptor
0 0 0
View 2 Replies
View Related
Jul 15, 2013
I'm using multiple C++ files in one project for the first time. Both have need to include a protected (#ifndef) header file. However, when I do that, I get a multiple definition error.
From what I found from research, adding the word inline before the function fixes the error. Is this the right way to do this, and why does it work? Should I make a habbit of just declaring any function that might be used in two .cpp files as inline?
View 5 Replies
View Related
Mar 1, 2012
Say I have 5 vectors of unsigned char each of size 5. I want to take the max of each index and store it in a new vector. What is the most optimal way to accomplish this?
My slow code:
Code:
vector<unsigned char> vec1;
vector<unsigned char> vec2;
vector<unsigned char> vec3;
vector<unsigned char> vec4;
[Code]....
View 3 Replies
View Related
Apr 1, 2014
My professor asked my to make a program that makes the "FCFS","SWJ" operations using any programming language actually i preferred c++ i like it more than java so i started in it but i'm facing a little problem ,,, which is i cant enter multiple inputs with a space tabs between them if this possible , for example : i want to get the arrival time and execution time from user
arrival (spaces " ") execution >> i want the input be like this
input1 (spaces " ") input2
View 10 Replies
View Related
Jul 18, 2012
Class1 {
public:
int value;
Class1(int value) {
this->value = value;
[Code] .....
i want use like this for that what can i do ...
std::map<class, Class2> map_Class;
View 1 Replies
View Related
Nov 28, 2011
I made a working version using absolute vextors being rotated by matrices and keeping relative vecotrs for translations. What I didnt like is that I HAVE TO use the standard XYZ axis for rotation.What I decided to do was use quanternions to store current rotation,cthen buffer rotations each time some were done and add it up.The way I see it, it should look somewhat like this:
(in the UpdateRotation part, plz dont mind any typos i make, this isnt the actual current code. Also on a small note I use dictionaries, so dont be surprised xD) Code: RelativeVectors["Up"] = Vector3.Transform(AbsoluteVectors["Up"], (Quanterion)CurrentRotation);
//repeat for Look and Right relative vectors
Quanternion Yaw = Quanternion.CreateFromAxisAngle(RelativeVectors["Up"], RotationBuffer["Yaw"]);
//repeat for roll and pitch
CurrentRotation = Quanternion.Contancate(CurrentRotation,(Yaw*Pitch*Roll));
//
clear the rotation buffer Whats happening right now tho, is that doing this exactly doesnt actually do anything, so I have to use standard axis anyway.
View 1 Replies
View Related