- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 12
- Posts with Upvotes
- 11
- Upvoting Members
- 11
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
So I just started a "C" class and I've done my first few assignments but I feel like I'm over complicating the codes by using to many if else statements. Here's the assignment and my code. Please let me know what you think: [B]Write a program that asks the user … |
|
I am planning to write an application in windows which will temporarily block the configured websites irrespective of what browser I am using. As I am completely a newbie in this I want to know where to start. Please provide me with any useful links which can help me. If … |
|
Hi, pls try to observe the size(i.e. total) of object for below program and in different cases as commented out. #include<iostream> using namespace std; class B { int x; // try by commenting either data member and observe the object size int *p; public: virtual void show(){} }; int main() … |
|
I have a code which gives the maximum value I can get by filling the knapsack with the optimal set of weights. int arr[5] = {0, 0, 0, 0, 0}; int Weight[5] = {2, 5, 8, 7, 9}; int Value[5] = {4, 5, 7, 9, 8}; const int n = … |
|
Write a program that prompts the user to input the start time and the stop time in hours and minutes (use 24 hour format), and then print out the time spent in work in hours and minutes. For example: Enter start time : 9 30 Enter finish time : 13 … |
|
Hello everyone; I've been struggling with trying to figure out how to get this struct program to work and I'm at a total loss on this. Basically I need to create two structs POINT which will have an X and Y values, and a LINE struct which will include 2 … |
|
I have a file, 'date-list.txt' which has date in it. For example , 20 May 2012 . Now I want to compare this date with current system date and show the difference in days . How can i compare dates and shows difference in days in C++.? Im really a … |
|
Instead of using User input , how can I take an parameter input and convert it to a string, where I can than check for for input values. char values[17] = "0123456789ABCDEF" ; char numIn[15]; int num[15]; int ob, nb, i; |
|
Anybody of you got any idea what this "internal compiler error: Segmentation fault" means? I searched internet, but didn't get anything useful. Then I did my analysis. I found out something peculiar. The code that I am trying to compile is a file for unit testing one of our classes. … |
|
okay so here's my code but i knwo there's just something so wrong with the second/youngest one. the first/oldest part works though. int oldest = 0; // Determine and print oldest employee(s): for (int i=0; i<recordlist.size(); i++) { if (recordlist[i].age > oldest){ oldest = recordlist[i].age; } } cout << "Oldest … |
|
# Can someone help me with this program by fixing it I should finish it before tomarrow and I don't know where I went wrong# #include<stdio.h> //header file #include<conio.h> //header file #include<stdlib.h> //header file #include<time.h> //header file #include<math.h> //header file #define PI 3.14159 //header file indicating that pie is equal … |
|
Attached is my code for my homework for my C++ class. My problem comes from when I run the program. It returns a value of 1 every single time for the output of the "is it a leap year or not" part of my program. Then, when it outputs the … |
|
So I'm fairly sure I have everything in the correct order, it compiles correctly, but when I try to run I just crash after the first Employee ID input. I've tried all i can think and have searched the web yet can't figure out why it crashes. [CODE] #include <stdio.h> … |
|
Hi, I have overloaded assignment operator like below and it worked perfectly fine. [CODE]void Test::operator = (Test& obj) { this->a = obj.a; this->b = obj.b; } [/CODE] But when I googled more about this, I could see all of the examples used a different prototype like this [CODE]Test& Test::operator = … |
|
Need some help. My game locks up when you go to load file and it just locks up. Please help. [CODE] /* WumpusGame header file Contains the WumpusGame Class. This is the main workhorse of the program, and contains all of the global data, including the master world map. WumpusGame … |
|
hi all, How i do very large numbers division and also modulo division in c++ thanks in advance |
|
I'm trying to find the mode of a vector full of ints. To do so I created a map an tried to make it so that evey time a number occurs it increments the related key on the map. Right now I'm just getting the highest number in the vector … |
|
hi all how to find the size of int without using sizof operator thanks in advance |
|
Hi, I have to acess a vector, which is a member of a structure... Could you please help me.. |
|
Good day to everyone. I have this trouble of stopping the timer at a specific time, say I have to stop the timer at 1:30. When I try to run it, it doesn't stop. Please help. Here's my C++ code. [CODE] #include <iostream> #include <time.h> using namespace std; void wait … |
|
Hello, This code is for (hospital management system). This code allow you to add patients. There are two types of patients. which is: 1. Normal patient. 2. Critically ill patient. once you added any patient. You will be able to show all patient using "ShowAllPatient;" method. -> i want the … |
|
Hello, basically I want to return an array from a function (So I don't output things in the class - just main) But I seem to get the error: "invalid types 'int[int]' for array subscript" Here is the code: [code] #include <iostream> using namespace std; int matrix() { int matrix[10] … |
|
I was studying for an exam and came across two questions that me and my friends didn't know the answer to. We are given the answer but we just can't figure out what the answer is what it is. First, why does this code give an error? [CODE]int z=5, q=2; … |
|
Pls help me on this. I really dont have an idea of solving this. Here's the question .. 1. Write a c++ program that generates the following series: 0 -1 4 -9 16 -25 36 -49 64 -81 100 and also this one 2. write a program that generates the … |
|
So, as follows I have a basic while loop. It's working fine, however whenever I enter something other than a number or EoF, it goes through the loop one time after I'm wanting it to stop. Say I enter 5, then EoF, it enters an extra 5, so I have … |
|
Hi everybody. I'm trying to write the program that will read the file and delete blank spaces ONLY after the text. here is the text : [CODE]serg@serg-PORTEGE-Z835:~$ cat sample.txt Now is the [/CODE] here is the the same in hex: [CODE]serg@serg-PORTEGE-Z835:~$ od -x sample.txt 0000000 2020 2020 2020 2020 2020 … |
|
Write a statement that declares and stores the elements of the following array into a vector object: char vowels[5]={'a', 'e', 'i', 'o', 'u'}; I think this is what I need, but I want to verify this. [CODE]char vowels[5]={'a', 'e', 'i', 'o', 'u'}; vector<vowels> vowelsList (vowelsArray, vowelsArray +5);[/CODE] |
|
Hi everybody. I'm new in C and would like to know how to delete last elements in the array? lets say I have array arr = {1,2,3,4,5} and whant to delet last two elements. is it possible to do? |
|
Hi I came accross a code and i din't understand it Template.h [CODE] #define FRIEND_NEW template<class T> friend inline T* ::safe_new(const char*,int); template<typename T> inline T* safe_new0(const char* file, int line) { T* ptr = new T(); return ptr; };[/CODE] A.h [CODE] #include "Template.h" class A { FRIEND_NEW protected: A(); … |
|
I can't figure out what this error is saying. Error: C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp||In function 'bool operator==(const statistic&, const statistic&)':| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|226|error: passing 'const statistic' as … |