I would like to create a C program which requires the input in this form: number1 operator number2, where number1 and number2 are numbers of type double and operator is one of the characters +,-,*,/.
There is my attempt to write this code:
Code:
#include <stdio.h>
double main() {
char operator;
[Code]....
Now I have to solve these problems: This code above doesn't work and I don't know why.I don't know how to fix the case when some user enters the input in this form:
Code: 1.5896 *5 or
Code: 7 / 5
I mean how the program knows that
Code: 1.5896 *5 is the same as
Code: 1.5896*5
I don't know how to fix the case when the user enters the input in the incorrect form for example
writing a program that requires exception handling. if an error occurs, i what the program to go back to the begging of the loop. i tried using break but that just makes the program crash when it receives a bad input. how do i do this? this is what i have so far (this part of the program any ways)
while (! quit) { // Output phone book menu cout << endl
I need to create a program that will prompt the user for an input, then it will save their input to a file and then it will prompt the user to input "Open" and then the file containing their first input, will open up and show their input.
Create a program that will let the user input an amount in the form (367). The Program should determine the no. of coins for each dominations : 50,25,10,5,1. (using Turbo C)
Im trying to create a program that has the user input a 5 digit number. If it's between 10000 & 99999, it will do one thing..(just saying 'yes' for now. Outside those numbers will prompt the user to input again. However, if the user inputs the exact digits 76087, it should display 'term'.
This current code is displaying 'term' whenever the user inputs the 5 digits.
Code:
#include <iostream> using namespace std; int main() { int pin; cout << "Welcome to Movie Food Enter your 5-digit pin code: " ;
I have an assignment in which i must create a program which prompts for user input of current and birth date, which will compare said dates and output if its your birthday or not. I've completed a large portion of it, but cannot figure out how to get the user input of month as an integer such a 2 into February.
#include <iostream> using namespace std; class DayOfYear { public: void input();
I need to create a program that prints a certain number of asterisks based on user input. The user inputs 5 and I want my program to output "*****". How would I do this in C? I've tried printf("%#**", myvariable) but this does not work it only prints "*".
C programming: I want to creat a program that asks the user to input the integer lengths of three sides of a triangle, and if so whether the triangle is a right-angled, acute or obtuse one. i am having some doubts about the if, else if statements. I never seem to know how and in what order to use them.
Code:
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(int argc, char *argv[]){ int SideA; int SideB; int SideC; }
I am trying to create a simple interface on console to allow to input some values to some variables. For ex:
int main() { double a = 1.5; double b = 2.5; double c = 3.5; string x;
[Code] ....
However, I want these three to display at the same time (now they display one by one), and in the console window I can move the cursor between input place of a, b and c with "arrow key" of keyboard.
This program is meant to present users with a list of rooms they then press the 'Select' button and it starts the relevant program for that room. However when running the program on Windows 8 it is giving an error that 'The requested operation requires elevation.'
using System; using System.IO; using System.Collections.Generic; using System.ComponentModel; using System.Data;
[code]....
P.s. It runs the programs as local administrator so that the user does not get prompted for UAC permission, as this is something the users find very annoying!
I am trying to create a five second timer that allows a value to be entered in that span of time. However, if a value is not entered within the five seconds, the timer ends and a value will no longer be able to be entered. I am trying to create a math test that has a five second time limit for equations to be answered.
I want to create three files whose names are same but extensions are different. I have to take the name from user. I tried following code but it didn't worked ...
Code:
printf("Name of the file:"); scanf("%s",name); printf("Format of Input file:"); scanf("%s",ext); f1=fopen(name.ext,"r"); f2=fopen(name.dat,"w"); f3=fopen(name.src,"w"); f4=fopen(name.RMH,"w");
Error1error C2955: 'DoubleLinkedListInterface' : use of class template requires template argument listdoublelinkedlist.h10 Error2error C2244: 'DoubleLinkedList<T>::DoubleLinkedList' : unable to match function definition to an existing declaration doublelinkedlist.cpp7
Error3 .cpperror C2244: 'DoubleLinkedList<T>::~DoubleLinkedList' : unable to match function definition to an existing declaration 12
.h
#pragma once #include "DoubleLinkedListInterface.h" #include "Node.h" #include <iostream>
I can't compile this code as I am at work and the computers are security protected, So i''l have to wait until i get home to test this, but I am pretty sure I am wrong. The problem is I have to create two vectors with 10 elements and input random numbers into it, then pick one of the elements of the second vector at random and append it to an element from the first vector at random. This has to be done 10 times and the I am assuming i have to print the 10 results. This is what I have:
#include <cstdlib> #include <ctime> #include <iostream> using namespace std; int main() { vector<int> random (10);
I have a problem with creating a process and waiting until the main window of the new process was shown. I thought I can wait for it with
WaitForInputIdle(pi.hp,INFINITE);
But when the function returns, the handle of the main window of the new process is not available. If I include also a ::Sleep(), the new window is available. Sleep is a bad solution. How can I do it?
I want to create a program that would take an AVI file, alter each frame (ex: change contrast, invert colors, etc.) and dump a new AVI. I've wrote a simple program for this experiment that loads up the header information from the video and dumps it. It also dumps a list of the frame data chunks within the 'movi' chunk.
The info I've gathered from coding this:
1. The recommended buffer size for each type of stream (vids, auds, etc.) is the size of the largest frame of corresponding type, plus 1 or two extra bytes.
2. numFrames in main header is the total number of frames for all types of data (video,audio,etc.) The 'length' value within stream header of type 'vids' is the number of video frames. The sizeImage value within BITMAPINFOHEADER is 921600 (==640*480*3) and the specification states that, quoth, "This can be set to 0 for uncompressed RGB bitmaps."
3. This video uses DIVX encoding.
Now my problem is this: How do I get the data within each video frame in a simple BMP like format? Even the uncompressed frames (with chunk id 'nndb') have variable sizes...let alone the compressed ones.
Information about a software that converts AVIs to a format with fixed sized uncompressed frames. Or at least some information about the frame decompression techniques.
Here's a dump made by the program for a 9 sec, 640x480 video I recorded from Pokemon. (Without the frame dump that is, it'd have made the post too long.)
What I am trying to do is to have the program create 2D array that for each row, no two numbers are the same and only consists numbers between 1-9. The array lists out every possible combinations. Supposely I do not know the number of possible combinations, I had it keep adding new rows until there are no more possiblities left.
The problem with my code is when I print out the completed array, it gives out really, really large numbers. But when I print the array from inside the first loop, it gives correct values. I do not know exactly what happened.
Code: #include <stdio.h> int main(void) { int double_digit[1][2];
i want to create a program which consist of 2 function. one function should find the greatest number and the other one should calculate the average but when i run this program i get segmentation fault
You are to create a program using nested looping. Your program is to have a menu asking the user to select which pattern to create and how many rows to use (it should accept 1 to 10 rows and keep the aspect ratio of the pattern). The patterns are 1 - Box, 2 - V, 3 - Inverted V. Note, if I select pattern 1 with 10 rows, the box will have 10 asterisks in the first row.
Okay so i came up with the box but i have been getting stuck at getting the V or inverted V.
Im trying to create two box in this program using the default constructor. When i call to try and display the info, it says that x, y, and z are not declared in this scope. i wanted to have the user cin the length, height, and width using the void setBox function.
#include<iostream> #include<string> #include<cstdlib> using namespace std; class Box{ public: