I have a problem with a program..I wanna make a program for scan the computer screen.I mean for example there is a video which shows just 5 pictures(apple,pear,banana,strawberry,cherry pictures) but this pictures are turning nonstop in one second. and this case is continuous progress.There are 5 pictures and are chancing. Lets get my problem, I wanna make a program and when apple on the screen my keyboard will push 1,when pear on the screen my keyboard will push 2,banana is 3,strawberry is 4,cherry is 5. I have this 5 pictures which are in the video and I will introduce tham to program and I wanna compare my lib. and screen and get output.
The project is "Design and write a program to model the operation of incoming flights computer screen that is normally found at a typical small airport like Moshoeshoe I airport (if they do have one). The following provides the information that needs to be displayed about each flight:
• Airline - [string of maximum length 15] Name of the airline, eg. FlySAA • Flight Number - [string of maximum length 5] eg. 04120 • Origin - [string of maximum length 25] Place where the flight originated from eg. Johannesburg • Date/Time - [integers: Hour, Minute, Day, Month, Year] Arrival time of the flight • Status - [string of maximum length 15] Whether the flight is "OnTime" or "Delayed"
This program will allow the user to input string then scans the file if it contains the same string given by the user. But i always get "MATCHED" even if i enter random string. I tried and tried to place the if statement in different positions but i dont get my expected output.
Code: #include<stdio.h>#include<stdlib.h> #include<time.h> #include<string.h> int main() { int found;
I'm attempting to write a program that will respond to me a lot like cleverbot or Siri. I can take care of making the program do the things I want it to do such as shutdown the computer, play a song, or whatever but I do not yet understand how to make it read strings I say, and make sense of them using certain words in that sentence. I could probably make an endless if statement to see if a string entered (using cin on a string[]) matches a certain other string, covering a million different sentences with a million different combos of words and spelling and capitalization but I want to enter a sentence and have the program search for keywords and then act on them. For example, with "shutdown" and "computer" being the keywords that make the program run the shutdown operation, so that whether I say "Yo, program, shutdown this computer for me!" or "Shutdown this computer", it will use the common terms here, "shutdown" and "computer" to know what to do.
I am writing a program in which the computer will read a txt file and encypt it. The encryption works fine, but the computer cannot read the file perfectly. If there's a newline, the scanning process stops. For example I have the following text in the txt file.
One two three four five (newline) Six seven eight
The computer will stop reading after 'five'. I assume that is because I use fgets.
I have a weird problem, my computer restarts imidiately after program writen in dev-cpp is compiled AND run. When I run any program, it lasts about 1 second, then program closes, and computer reboots. It doesn't matter whether program is writen now or earlier, my dev-cpp version is 4.9.9.2. Source code can be as simple as this:
#include <iostream> #include <conio.h> using namespace std; int main() { getch(); return 0; }
I am making a program where a computer and player take turns rolling dice.
There seems to be an issue somewhere in my loop where when the player selects from the possible dice choices, it rolls for the computer and does not select the choice and it immediately becomes the player's turn again.
I am trying to get it to where when the computer rolls the dice, it should display the list of possible values, and ask the user to hit the enter key in order for the computer to choose which value to select using the following command:
Code: while ( getchar() != ' ' ) ; I've tried it a hundred times and no matter where I put the command it still skips the computer's turn.
Below is my code:
Code: while (compscore < 99 && playerscore < 99){ printf("You have rolled the following pair of dice: "); a =("%i ", rand() % (MAX_VAL - MIN_VAL + 1) + MIN_VAL); b =("%i ", rand() % (MAX_VAL - MIN_VAL + 1) + MIN_VAL); multiply = a * b;
I'm currently creating a guessing game program where the user will be asked to guess the computer generated number. Once the program is finished, at the end the user will be asked if they want to play again. If the user types "Y or Y" the program will loop and when the user types "n or N" it will not loop. Check out my code below.
#include<iostream.h> #include<stdio.h> #include<dos.h> #include<stdlib.h> #include<conio.h> #define g gotoxy void main(){ int a,l,b,guess,row,col,answer,num,clue=5;
Night now I'm working on part of a function that scans in two sets of coordinates. Is there a way I can scan both sets of coordinates in with the same scanf?
Code: printf("What are the first coordinates for destroyer: "); scanf_s("%d%d", &destroyer_1, &destroyer_2); gameboard[destroyer_1][destroyer_2] = 'd'; printf("What are the second coordinates for destroyer:
I'm trying to write a program that prints all of the prime numbers to the screen. I'm getting angry because it only prints EVERY number. I think it has something to do with the bool change not being able to leave the for-loop but how to fix it.
Code: #import <stdio.h> #include <stdbool.h> int main(void){ printf(" The Primes Are: 1");
So, I'm making a program in C++ that emulates a full screen console... I used SetCurrentConsoleFontEx to set the font to 12x16 but it sucks...
Anyway, I read here: [URL] .... that also the console font can be changed, but I can't make it work! How can i set the font to Lucida Console? This is the function I use to change font size:
I wanted to make the terminal screen bigger in my NCurses program. Let's say if the defaults are 25 LINES and 80 COLS, I want to set them to 40 LINES and 120 COLS.
I've tried resizing all windows, but that did not work, because the actual terminal (console) was not resized. Then I found functions resizeterm and newterm, but they did not work. As far as my understanding goes resizeterm only updates NCurses information with the current configuration, while the window itself is not actually modified.
NCurses man page wrote:The function resizeterm resizes the standard and current windows to the specified dimensions
If I haven't made myself clear ( I sometimes make a mess of things... ), another example would be that I want my program to be fullscreen when I start it. Is this possible? It should be, I found a fullscreen NCurses program once, but the code was too confusing for me to understand.
Having read about things like SIGWINCH, I assume you must define a method for resizing the terminal screen yourself, I don't know where to start?
I have to write a program that stores information about students and displays results (Formated). Example-
Inputs ( # of students, First and Last name of student, the gender, age, and hieght. (height inputed as inches and outputed as feet and inches))
Student 2 --------- Jett, Joan Female 100 years old 5' 7"
Ive been falling behind a little due to working late and barely having time for my school work. Coming across several issues, one being an error with GENDER (Error C4700: uninitialized local variable 'gender' used:). As well as how to format the end result, i understand that u have to use #include <iomanip>, but am confused on how to format correctly.
For my C programming module, I've been asked to create a program which is basically a ten question mathematics quiz or test if you like. Below is a copy and paste of my current, working program.
Code:
#include <stdio.h> #include <stdlib.h> #include <time.h> int main () {
[Code]....
I am also trying to include into my program; If the user achieves 4 or less marks in the test, they are asked if they would like to repeat the test (have a second chance).
I have been asked by my Lecturer to ask the Question; "Would you like to try again" and the response is 'Y' for yes, 'N' for no. Would this be shown by:
char Y = Y; char N = N; printf("Would you like another go?"); scanf(%d%, &Y, &N);
And finally; If the user would like another go, then I am trying to include the code that clears the screen and then reloads the program?
What code is used to clear the screen and no clue what code is written to refresh or reload the program. I assume it's a loop statement or some sort.
I seem to be missing a concept or 2 here ... I am tasked with writing a program that reads text from a file and outputs each line to the screen as well as to another file PRECEDED by a line number ...
In addition, I have to Print the line number at the start of the line and right-adjusted in a field of 3 spaces ...
Follow the line number with a colon then 1 space, then the text of the line.
Another kicker, is I have to grab the data 1 character at a time and write code to ignore leading blanks on each line.
Here is what I have so far:
#include <iostream> #include <conio.h> #include <fstream> #include <string> #include <cstdlib> #include <cctype> using namespace std; int main() { char next; int count = 0;
Basically this is what i need to do. Write a program that reads a number from the keyboard, separates it into its individual digits and prints the digits to screen, each on its own line followed by the same number of stars as itself.
For example, if the number is 2339 the program should print
9 ********* 3 *** 3 *** 2 **
So far i have managed to separate the number and have them on different lines, but how to implement the stars onto each line with the number!
My code so far:
int main() { int n; printf("number? "); scanf("%d", &n); while (n > 0) { printf(" %d
I am starting to learn C, its quite an easy language to learn from the basics, I hope to learn others as time goes, I wonna know how do I get the external / remote IP of a computer?
I'm looking for a way to run my console app in C# on one computer, but the actual program is ran on another computer. IE I open the file or hit "Run" in Visual Studio on computer1, the computer2 runs the program. I was looking online and found some stuff that may be applicable, but I didn't see a very clear answer.