49,756 Topics
![]() | |
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() … | |
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 … | |
/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 … | |
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 … | |
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 … | |
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 … | |
// 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, … | |
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 … | |
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 … | |
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"; } } | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
How to create a tweening effect to morph the alphabet A to the alphabet Z using OpenGl/Glut and C++ ? | |
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 … | |
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 … | |
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; … | |
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 … | |
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) … | |
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 … | |
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 … |
The End.