I have a dice roller program that I want to use in different program and I know there is a better way to add than copy and paste all of the code, but dont know how. Can I attached it as a file and call the file in my main program?
I created program that insert employes data and then print their data but never accept duplicate age if user entered duplicated age prompt him to enter another age (age must be unique)
How to insert a node and print it out. I am not sure if I am doing this correctly or if I am missing anything. It seems that the head keeps getting overwritten with the most current key and that the nodes are not pointing to each other.
Here is my code so far:
Code:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> // Global Declarations typedef struct { int key;
My program will ask the user to enter the number of lines for the sentence "I will always use object Oriented programming. " if for example, the user enters 3, it should print out
I will always use object Oriented programming. I will always use object Oriented programming. I will always use object Oriented programming.
the second part of my program asks the user to enter the line which we want to make a typo. If they enter 2, it will replace the "I will always use object Oriented programming. " with "I will always use object Oriented programing." in the second line.
this is how it should look like but I am having trouble putting the second part together. I don't know how to remove the sentence and replace it with the second part.
Enter the number of lines for the punishment: 6 Enter the line for which we want to make a typo: 3
I will always use object oriented programming. I will always use object oriented programming. I will always use object oriented programing. I will always use object oriented programming. I will always use object oriented programming. I will always use object oriented programming.
Make a C++ Program that will use nested if else and any looping statement to display the following a certain number of times depending on how many times the user wants it to do so.
Input Values: 1. Name of employee 2. Position in the company 3. No. of hours worked 4. Rate per hour 5. Overtime hours
Required Output: No. Name Position Rate per No. of hours Basic No. of overtime Overtime hour worked Pay hours Pay 1. Juan Manager 160 140 22400 10 2100
Computations: basic pay = no. hours worked x rate per hour overtime = overtime hours x 150% of rate per hour
Just asking how can I input the name, position, rate per hour, overtime hours and hours worked in a horizontal manner? Because I need to achieve the required output.
I have this code I wrote with some data and what I'm supposed to do is insert exception handling into the code. The problem is I've seen the basic examples of it. But I don't know how to implement it into my code.
#include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main(){ string filename, n; cout << "To find a file, type in the file name. " <<endl;
if (ds.Tables.Count != 0) { for (Row = 0; Row <= ds.Tables[0].Rows.Count - 1; Row++) InsertLSP(ElemStartTimeInPrograme, ..........) <-----------------------
[Code]....
i would like to check whether first insert call inside ds loop if is failed e.g due to connection problem this will be ended. What is best way to implement that?
template <typename T> void insert(BTree<T>* tree, T item) { if (tree == nullptr) { tree = new BTree<T>(item); } else if (item < tree->val) { insert(tree->left, item); } else { insert(tree->right, item); } }
I think this function may not be working because I am modifying `tree`, which is a local variable. How do I actually modify the current pointer that `tree` represents, not just `nullptr`?
I can't find why it won't output the correct info for the array. I've looked until I am ready to throw the computer out the door. I'm at my wits end trying to get this to work right. I finally got it to quit killing the compiler, but it's doing this. The problem is in the insertBefore or insertAfter function calls and I don't think that my copy constructor is right.
I am storing info in a vector but I want to store certain info at a particular index. I am new to using vectors and am unsure about have to do this. I am aware of the insert method but am confused on how to use it to store at a particular index.
So I am trying to create a simple binary tree that will ask the user for a command so that is either 'insert or find' and with insert they can put in a number to this tree and with find they can ask if 53 is in this tree and the program will output yes or no..
I'm trying to insert into the database I created, values entered by the user. But I can't find how to insert them it looks like this:
//Go for the user infos cout << "What is your ID ? : "; cin >> id; cout << "What is you letter ? : "; cin >> letter; cout << "Your letter is "<<letter<< " and your ID is "<<id<<"
[Code] ....
I don't know how to proceed, I receive a error here for the sql2 statement
error C2296: '<<' : illegal, left operand has type 'const char [36]'