No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
We're supposed to create a program using TDD in our CS class but i'm not entirely sure how it works... You're supposed to create a fail test before you write code...how can you do that? I can't find any examples online :( |
|
I'm having problems with this c++ program. I need to read a file containing years on each line, and determine if the year is a leap year. The isLeap function looks fine, i'm just having problems actually reading the file and implementing the function. Can anyone help me out? [CODE]#include … |
|
Ok, so i'm supposed to create this ADT structure and i'm having problems storing data into a function and printing it. These are the three files I have: [CODE]#include "myBook.h" #include <stdio.h> #include <stdlib.h> Book *createBook(char title, float price, int stock, char person) { Book *myBook; myBook = (Book*) malloc(sizeof(Book)); … |
|
Can someone please show me an example of how to read lines from a file with this format: Book One 49.99 1 Authors Name I know I am supposed to use fgets since there is whitespace in the strings, i'm just not sure how to read and store the data … |
|
I am stuck on this program that I am supposed to create. It has to ask the user for a text file where the format looks like: MATH 101 GEOLOGY 101 GYM 101 Then i'm supposed to store the information from the file in an array which then gets pointed … |
|
I'm supposed to ask the user to enter a number of marks, and to decide what each mark is. Then my program is supposed to find the min and max in the array, so far this is what my code looks like: [CODE]#include <stdio.h> void findMinAndMax(int arrayMarks[], int numOfMarks) { … |
|
Hi everyone, I am having some trouble here... I am asking the user to enter a file, and that file will read the contents and determine if the student will pass or fail the class. That part I am having trouble with is when I have to decide if the … |
|
Hey everyone, I'm trying to get this code to work... [CODE]#include <stdlib.h> #include <stdio.h> #include <stdbool.h> int allPrimes(int n) { int kiloN = n*1000; int count = 0; int i; for(i = 2; i <= kiloN; i++) { boolean hasfactor = false; int j = 2; while(j<i and !hasfactor) { … |