49,761 Topics
| |
this is the question given by my lecturer :- Write a program to accept 5 students (names) and their respective test marks into an array or arrays. Sort them and print the lists in: a) alphabetical order b) mark ranks(from highest to lowest) and my input is enter name : … | |
Write a function ListSplit that will split a circular list containing an even number of nodes, say 2k, into two circular lists each of which contains k nodes. The function should have three parameters and should work so that the function call ListSplit(list,sub1,sub2); will create new lists pointed to by … | |
Hi! I'm trying to write a code for my arduino project. it's an SMS-based Led matrix display. I seem to have problems with SRAM memory because of the size of the code. can you help me optimize it? #include "cmap.h" #include <SIM900.h> #include <sms.h> #include <SoftwareSerial.h> #define INTEN 6500 //speed … | |
May someone help me.. A kilogram is 1000 grams. Write a program that will read the weight of a package oof butter and output the weight in kilograms, as well as the number of package of butter needed to yield 1 kilogram of butter. Your program should allow the user … | |
Let x be a node in SLL. Write a C++ function to delete the data in this node. Following this deletion, the number of nodes in the list is one less than before the deletion. Your function must run for O(1). | |
The father of C++, Bjarne Stroustrup took part in a live Q&A via Google Hangout-On-Air. The Q & A was moderated by Patrick S, one of the moderators from the C++ Google+ Community, and Brad Y., of Pearson Ed/InformIT. The Q&A session was a public event. PS:This is not your … | |
int Cabin (int n); int _tmain(int argc, _TCHAR* argv[]) { cout << Cabin(8) << endl; return 0; } int Cabin (int n) { if (n == 1) return 0; else return Cabin(n/2) + 1; } Hi ,can someone explain why is the answer 3 here:if to folow the formula the … | |
I have written some code that contains a system to report error messages to error log file. I use a class structure to do this. However, some parts of the code contain functions that I think might be useful in a more generic context. So, I am trying to use … | |
//Hi Lads.This is my first attempt to create template functions. //Here is the main ,which needed to create Locate.h file/header and //in that Locate.h create templates to support the main. //If the value does not exist in the array, -1 is returned. // Templates.cpp : Defines the entry point for … | |
The area of the circle is defined as A = Ï€ . R2, having Ï€ as 3.14159. Calculate the area using the formula given in the problem description. Input Read the variable R (double precision), that is the radius of the circle. Output Print the variable A, rounded to four … | |
Hi, I have a Blackboard object which is a singleton, what it does is store the message and the reciever. The challenge is that the blackboard will send an alert to the reciever and the reciever have to check the blackboard for the message. class Subscriber{ public: virtual ~Subscriber() {} … | |
I keep getting access violations even though I made sure to make all my methods and functions const! Driving me insane. When I add a player then try to display all players the program tries to read my privates then gets violated. (Still lots of bugs in it elsewhere, but … | |
by several reasons, i must create the static with it's paint message: case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(inst->hwnd, &ps); if(inst->Paint==NULL) { RECT f; GetClientRect(hwnd,&f); HBRUSH s=CreateSolidBrush(inst->clrBackColor); SelectObject(hdc,(HBRUSH)s); if (inst->clrBackColor==-1) { //hide, copy the parent control and show the control again ShowWindow(inst->hwnd,SW_HIDE); BitBlt(hdc,0,0,f.right-f.left,f.bottom-f.top,GetDC(GetParent(inst->hwnd)),inst->intLeft,inst->intTop,SRCCOPY); ShowWindow(inst->hwnd,SW_SHOW); } else FillRect(hdc,&f,s); SetBkMode(hdc,TRANSPARENT); … | |
Suppose we have a polynomial f(x) = 4 – x3. We want to find the value of x that makes f(x) = 0. (This value, call it t, is the cube root of 4. In fact we can use the bisection method to find the nth root of a number.) … | |
I need a C++ program to implement a heap based priority queue which accepts job ID, priority number and submitter name as inputs. the program should heap sort whenever a new job ID or priority or submitter name is entered. The jobs that have maximum priority should be extracted (along … | |
In the following program, where is pt1 getting it's values (1, 0)? I get pt3's values (5, 10) because I can see them in the code. #include <iostream> using namespace std; class Point { private: int x, y; public: Point() {} Point(int new_x, int new_y) { set(new_x, new_y); } void … | |
I need help combining the file name with the filepath my code: WIN32_FIND_DATA FindData; HANDLE hFind; hFind = FindFirstFile(L"../art/*.dds", &FindData ); if( hFind == INVALID_HANDLE_VALUE ) { PrintCharS("Error searching directory"); return; } do { char ch[260]; char DefChar = ' '; WideCharToMultiByte(CP_ACP, 0, FindData.cFileName, -1, ch, 260, &DefChar, NULL); string … | |
What is the difference between access modifier, modifier and qualifier? It's a competition exam question. and is a very important question from exam point of view. plz help me to get the answer of this question. | |
Using strictly pointer data type, write a modular C++ program that makes use of a single function called convert() to sort two integer numbers passed to it as arguments, exchanging them if the first is smaller than the second (Descending order). Example: if the function is called in main() as … | |
How many times is the inner loop body executed in the following nested loop? for (int x =1; x <= 10; x++) for (int y = 1; y <= 10; y++) for (int z = 1; z <= 10; z++) cout << x +y+z; | |
For instance, ABBA is a palindrome, but ABCBB is not. You are given a string s. Return the length of the longest substring of s that is a palindrome..program in c++ | |
Hello. I have a following verse: >A swarm of bees in May >Is worth a load hey; >A swarm of bees in June >Is worth a silver spoon; >A swarm of bees in July >Is hot a worth a fly. And I have to modify this text so that all … | |
I am a student in Computer Science, and am writing a small guide for my fellow students. It will contain a large list of the most commonly used and studied functions in C++ (e.g. Bubble Sort, linear search, file writing, etc.) and the code used to perform each function. I … | |
The loan officer at the Belize National Bank wants you to write a C++ program that would help him decide whether to approve small loan application. The program should prompt the user for the customer’s yearly income, the number of years of the loan (loan period), the amount of the … | |
Say I have something similar to this: http://faculty.utpa.edu/chebotkoa/main/teaching/csci3336spring2013/slides/lexsyn/sample-lex-syn.html Does anyone know how I would be able to make "\n" or "\t" recognized as a token? I would probably need to add a case for it in the switch in LexicalAnalysis.cpp, right? And add it to the state diagram? But how … | |
Come up with a program that prompts the user to enter three movies and display the entered information using your understanding of data strucures. // Structures3.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> #include<string> #include<sstream> using namespace std; # define N_movies 3 struct movies_t{ … | |
from reading these site: http://www.catch22.net/tuts/flicker-free-drawing i understand that i must avoid the pixel been changed more than once and a double-buffer: //how avoid the pixel be changed more than once: case WM_ERASEBKGND: return 1; //for other controls, we must use another messsage(see the child control messages) and heres how we … | |
Hello All, I am writing c++ program to insert, sort, display and merge two linked lists. Insertion, sorting and display functions are working fine but merge function is not working as expected. Please help me correcting merge function. I have used One header file "intSLLst.h" and two cpp file "intSLLst.cpp" … | |
hi there people i got a prob with my code in my problem i got a matrix and i need to find the even number or numbers on that matrix (12x30) (by the way is the even minimun or minimums), so here is my function "tempeven" part., the actual issue … |
The End.