Hello I have a homework question and although I'm not looking for someone to answer this for me, a guide would be appreciated from senior programmers here. > A disc can transfer only one 512 byte block with each access. Student records are 80 bytes longs, are to be organized into hash buckets. How many records should each bucket contain? Thanks!

Member Avatar
Member Avatar
+0 forum 1

Hello, I'm working on an assignment right now and I need some feedback. My project is to implement a graph that uses an adjacency list like an Edge list. I'm fairly new with these and I would apprecite if anyone can see my code if I'm on the right track. Thanks! #include<iostream> #include<string> #include<list> using namespace std; #define D true #define U false #define W true #define N false #define MAX 100 class Edge { public: Edge() { } Edge(int from, int to, double weight = -1) : from (from), to (to), weight (weight) { } Edge(const Edge & other) …

Member Avatar
Member Avatar
+0 forum 2

Hello, I need some advice on how this function outputs the left zeros so everything will be even at 16 bits [CODE]string conv (int num, int base) { if (num == 0) return "0000000000000000"; char NUMS[] = "0123456789ABCDEF"; string result = ""; do { result.push_back (NUMS[num % base]); num /= base; } while (num != 0); return string (result.rbegin(), result.rend()); }[/CODE] Current Output: 100111110101 GOAL: 0000100111110101 Thanks in advance!

Member Avatar
Member Avatar
+0 forum 1

I'm having an error "a value of type "double" cannot be used to initialize an entity of type "double *" Any tips? Thanks! [CODE]#include <iostream> #include <string> using namespace std; struct sample { string name; double *num; unsigned elements; }; int main () { sample x = {"Dude", [COLOR="Red"]{1, 2, 3, -5}[/COLOR], 4}; } [/CODE]

Member Avatar
Member Avatar
+0 forum 7

Good day to all, I'm doing a project about inverse permutations from an array of permutations. It's my first time coding on permutations so I don't have any experience on this. So I came up with a solution to just swap the array and the element number as the inverted permutation. Here's my code by the way, I'm just wondering if the "seasoned" members here have any tips on doing an inverted permutation properly. Please let me know if you guys have any advice. Thanks! [CODE]void inverse ( unsigned ip[], const unsigned p[], unsigned elements ) { unsigned tempArray = …

Member Avatar
Member Avatar
+0 forum 7

Hello, what's the best way to sort a string to ints & chars. For example: "John Doe M 36" to John Doe (char[]) M (char) 36 (int) I researched about istreamstring sin(), but I'm not yet fully familiar with it, any tips. Thanks!

Member Avatar
Member Avatar
+0 forum 6

Hi, I'm writing a program that checks parens/brackets/braces if they are paired. Tha catch is I have to write my own stack functions, this is my code so far, it used to work when I was working with just the parentheses, now that I added more options it's not working and now I'm lost, any expert advice or tips from a second pair of eyes? Thanks in advance. BTW, did I write my initialize() and top() functions correctly? Thanks again! [CODE]/* This little program checks to see whether the left and right parentheses / brackets / braces characters are properly …

Member Avatar
Member Avatar
+0 forum 9

When I click on any of my menu bar, the menu wont expand or sometimes it does but missing some. I tried reinstalling and resetting it but it still doesn't work. Please help. Thanks. I attached a print screen of the problem.

Member Avatar
Member Avatar
+0 forum 6

Hello, I'm making a simple C calculator using only getchar and putchar functions, my program works only if the arithmetic is entered correctly but if it's not, I can't make the proper error checking on it if the arithmetic is enteres improperly. EXAMPLE: 4 + 7 = 11 =====> Works! 7 * -3 = -21 =====> Works! 4 [2spaces] + [3spaces] 7 =====> Won't error check. % 5 =====> Won't error check. 4 * =====> Won't error check. Any suggestions please? Thanks! [ICODE]/* #include <stdio.h> #include <ctype.h> #include <stdlib.h> void error (int), add (int, int, bool, bool), subtract (int, int, …

Member Avatar
Member Avatar
+0 forum 3

Hello, I'm starting to learn Java and this one of my homework but for some reason it won't run. My algorithm is to just add all 1-1000. I highlighted the part that's causing a problem in red. Please help, thanks! [CODE] import java.util.*; public class thousand { static final Scanner in = new Scanner ( System.in ); public static void main(String[] args) { int n = 1000; int total = [COLOR="Red"]n[/COLOR](n+1)/2; System.out.println ("%i" + total); } } [/CODE] This is the error code: [CODE] thousand.java:10: cannot find symbol symbol : method n(int) location: class thousand int total = n(n+1)/2; ^ …

Member Avatar
Member Avatar
+0 forum 2

I wrote this string palindrome program that reads input from a text file. All the syntax are correct but I have an error I couldn't understand. Any help is appreciated, thanks!!! First, this is the error message: [B]Error 1 error LNK2001: unresolved external symbol "char * newToCheck" (?newToCheck@@3PADA)[/B] And this... [B]Error 2 error LNK1120: 1 unresolved externals[/B] This is my code so far: [CODE] #include <iostream> #include <fstream> using namespace std; const int strSize = 0xFF; ifstream infile; char checkPhrase[strSize], origPhrase[strSize], newToCheck[]; int cleanup (char*, int), newCount; bool palindrome (char*, int, int); int main() { infile.open ("C:\\Documents and Settings\\student\\Desktop\\PalindromeData.rbh"); if …

Member Avatar
Member Avatar
+0 forum 2

Hello, I'm trying to create a program that reads data from outside file using functions. My goal is to get data from an outside file, and use that data for other functions that i havent created yet. this is my code so far but it wont read and giving me output errors. PLease help, thanks so much! [CODE] #include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; ifstream infile; ofstream outfile; int noOfAdults, noOfKids; float deposit; string mealType; bool weekend; void getData (); int main() { infile.open ("C:\\Users\\garu525\\Desktop\\CateringDatafile.rbh"); if (!infile) { cout << "File not found. Exiting. . …

Member Avatar
Member Avatar
+0 forum 3

I would like to program that reads a file with 6 lines that have 7 numbers on each line. The output should save a file with sum, average, max and min of each line. For now I just have to figure out how to get the max and min numbers the robust way. For starters this is my code. (please note that my goal for now is just to sort my 7 entered numbers) My code is not working and my total is wrong. Please advise. [CODE] //Program utilizing one file for input and one file for output #include <iostream> …

Member Avatar
Member Avatar
+0 forum 10

Hey guys, I'm wondering if you can help me out on my problem. I wrote this code to print out consecutive numbers till it reach the maximum number entered. The code works but I want to control the output. Here's my code so far... [CODE] cout << "Enter max number: " << endl; cin >> max; int num = 1; while (num <= max) { cout << num++ <<'\t'; } cout << endl;[/CODE] I want to control the output from this: Enter max number: 10 1 2 3 4 5 6 7 8 9 10 Press any key to continue …

Member Avatar
Member Avatar
+0 forum 4

I'm starting to learn the Pep/8 simulator. Do you know where i can find some tutorials? Thanks.

Member Avatar
Member Avatar
+0 forum 2

The End.