49,756 Topics

Member Avatar for
Member Avatar for mc3330418

I am trying to read in a word to a string and then output the letters, in alphabetical order, and count how many instances of that letter. array a 2 r 2 y 1 #include "ArrayList.h" #include <iostream> #include <string> struct ItemType { char letter; int count; }; int main() …

Member Avatar for rubberman
0
108
Member Avatar for zoyaa

write a program to calculate the striking rate of cricket team in c++ if score 90 and balls70 then gradeA,if score20 and balls 15 then gradeB, if score 10 and balls 10 thengrade is c,if score20 and balls 40 then gradeD,if score35 and balls30 then gradeE also algorithm and pseudocode …

Member Avatar for rubberman
0
50
Member Avatar for jhan.rhey.5

/Design a program that supplies numbers (9000 only) and outputs their equivalent Roman numerals. //the supply numbers and their equivalent Roman numerals are given below. //Supply number equivalent Roman Numeral //1 I //5 V //10 X //50 L //100 C //500 D //1000 M Sample Output: Enter integer (1-9000):1984 MCMLXXXIV …

Member Avatar for jhan.rhey.5_1
0
631
Member Avatar for lincy828

How could i convert One number system to another system? this is the output: Choose a number system below: Press A if you want Decimal to convert to another number system. Press B if you want Binary to convert to another number system. Press C if you want Octal to …

Member Avatar for ddanbe
0
369
Member Avatar for andrew mendonca

Write a program to read a maze from a text file into your array, print the unsolved maze, solve the maze, and then print the solution. You may assume the maze will fit in a 24-row by 81-column character array (for 80 character C-strings). The maze will be in a …

Member Avatar for owenransen
0
1K
Member Avatar for klfrancisco

I have a social security program that I need finished. I have the code so far but I need to know how to make is where the user can only input numbers and no letters. This is what I have and I just do not know how to program only …

Member Avatar for deceptikon
0
230
Member Avatar for hassan12

// onlyme.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include<stdlib.h> using namespace std; int inputa; int inputb; int Andgate(void); int orgate(void); int notgate(void); int andgate(void) { cout<<"input Gate A, enter 1 or 0, enter 2 to end program "; cin>>inputa; cout<<"input Gate B, …

Member Avatar for richieking
0
113
Member Avatar for beastie805

Basically I need to change the Two StudentType* functions to const but i know its not letting me because of the &ersand sign on the ReadStudentData function, is there anyway around this? I am not asking for someone to do my hw just point me in right direction it brings …

Member Avatar for richieking
0
182
Member Avatar for beastie805

this is probably a dumb question but how would I remove the array so that there is no max size on it. struct StudentType { string studentName; int testScore;//Between 0 and 100 char grade; }; const int NUM_STUDENTS = 20; int main() { StudentType student[NUM_STUDENTS]; } this is what i …

Member Avatar for beastie805
0
119
Member Avatar for Syafiq_1

How can i possibly use array to create a password program? #include <iostream> using namespace std; main() { int password[5] = {1,2,3,4,5}; int pass[5]; cout << "enter pass: "; cin >> pass[5]; if(pass[5] == password[5]) { cout <<"hey"; } else { cout << "error"; } }

Member Avatar for Learner010
-1
107
Member Avatar for Syafiq_1

why i cant move the formula under int main()? #include <iostream> #include <stdlib.h> using namespace std; double fIntoCm(double dIn) { double dCm; dCm = dIn*2.54; return (dCm); } double fYtoM(double dY) { double dM; dM = dY*0.914; return (dM); } double fOtoM(double dO) { double dM2; dM2 = dO*29.574; return …

Member Avatar for gerard4143
0
187
Member Avatar for Rawan_1

Complete program - design two recursive functions with menu: Write a program that asks the user to input a positive integer, and then produces a menu where the user can choose to either check if the number entered is a prime number or print the sum of all the integers …

Member Avatar for kal_crazy
0
151
Member Avatar for daniel.s.mattos

I am trying to create a simple string class, but i am getting a run time error. What i want to accomplish is to store a const char pointer to a char pointer. I am trying to use the strncpy function, i also tried the memcpy, but both gave the …

Member Avatar for kal_crazy
0
645
Member Avatar for deceptikon

This will be a relatively quick article because it's a simple issue. The `system` function gets a lot of flak for being slow because it calls the shell runtime to execute a command, but I rarely see the more devastating issue of security brought up. `system` is insecure in many …

Member Avatar for Assembly Guy
0
300
Member Avatar for m1m6jbr

I'm designing a LongDouble datatype which take a 16 byte space. my question is how to add or substract a two double numbers correctly ex : a= 3.025466 b=4.132655`` the result will be 7.158121 but in my code it's different here is my code LongDouble LongDouble::operator+( LongDouble olong) { LongDouble …

Member Avatar for kal_crazy
0
210
Member Avatar for Ghayth_1

hello everybudy i'm writing a code to revers a stack but i have a wrong output when i Calling the reverse function can anyone help me please :) :) # header.h # class intnode { public : intnode(int , intnode*); int info; intnode* next ; }; class Stack { public: …

Member Avatar for Ghayth_1
0
259
Member Avatar for Mehak murtaza

there is a large busy cosmetic store. In store, for billing, there are four counters with four tellers (who deal payment etc) . A customer comes to the store and collects the things he/she wants to purchase and go to one of the counters to pay for purchase. If there …

Member Avatar for Ancient Dragon
0
223
Member Avatar for princessophia

Here is the problem as it is written in the book: Write a function that accepts a C- string as an argument and returns the length of the C- string as a result. The function should count the number of characters in the string and return that number. Demonstrate the …

Member Avatar for Assembly Guy
0
252
Member Avatar for PulsarScript

Hi to all,can someone can help with animation project and help with the steps. I have canvas created and a few imagesof pacman 7x7 px ,how will i make him move left,then right,up? It something to do with positioning.And second question is how to put the diffrerent color on the …

0
93
Member Avatar for whatthebobo

Hey guys, Now that the previous problem was fixed I was finally able to run my program but now I just don't know what is wrong. Everytime I would enter in a few numbers and let it run, it would print out a series of the same number. Can someone …

Member Avatar for whatthebobo
0
265
Member Avatar for Learner010

would here anybody like to suggest some good books on pointers ? Actually some of my friends often say me that pointer is hard , too hard(however i've not started learning pointers , so i can't say). And i'd like to make the pointer concept very clear , so please …

Member Avatar for Learner010
0
292
Member Avatar for 759153

A weather analysis program uses the following array to store the temperature for each hour of the day on each day of a week. int temp[7][24]; Each row represents a day (0 = Sunday, 1 = Monday, etc.) and each column represents a time (0 = midnight, 1 = 1 …

Member Avatar for Assembly Guy
0
376
Member Avatar for Geek1024

How to create a tweening effect to morph the alphabet A to the alphabet Z using OpenGl/Glut and C++ ?

Member Avatar for owenransen
0
148
Member Avatar for andrew mendonca

Write a program to read a maze from a text file into your array, print the unsolved maze, solve the maze, and then print the solution. You may assume the maze will fit in a 24-row by 81-column character array (for 80 character C-strings). The maze will be in a …

Member Avatar for owenransen
0
526
Member Avatar for hartk1213

hi i am making my own version of tetris and i have most of it working but for some reason they tetrominos are not being drawing correctly. its 9 files of code so its going to be a wall of code here is a screenshot of what it is looking …

0
77
Member Avatar for christinetom

Hi everybody.. Hope you're all well. I'm having a problem. How can I test for white space characters in c++ ? If I do the below it doesn't seem to work. char char1; // iterating through a file if (char1 = ' ') { cout << "WHITE SPACE" << endl; …

Member Avatar for christinetom
0
129
Member Avatar for NardCake

Hello! I was extremely bored and stumbled accross this website: [Hackerrank](https://www.hackerrank.com) It's a website that contains lots of programming challenges of various types. I signed up and looked at some of the challenges, lots of them are quite over my head since I'm not that skilled or any expert by …

Member Avatar for NardCake
0
609
Member Avatar for whatthebobo

I am currently writting a code for my programming class and have come across this error. I do not know how to fix it and was wondering if someone can help me or give me some hints. for (index = 1; index < SIZE; ++); { if (values[index] < lowest) …

Member Avatar for whatthebobo
0
162
Member Avatar for H_beginner

I m reading data from a text file and then printing it. I am not sure what I am doing wrong but the program prints the last line that it reads twice. void bank_account::viewHistory() { ifstream in_file("bank_transaction_history.txt" , ios::in); if(!in_file) { cout<<"File error \n"; } cout<<"Event"<<setw(15)<<"Amount"<<setw(15)<<"Date"<<setw(20)<<"Current Balance"<<endl; string eve,dat; double …

Member Avatar for deceptikon
0
286
Member Avatar for Cj

For my c++ class i have to write a code that will read integers in to a 2D array from a file and then, using functions/methods, determine if the array is a magic square. My problem is that when i build or compile i get "error C2664: 'DataIn' : cannot …

Member Avatar for richieking
0
999

The End.