Scheme How to create a list.
Okay this may sound like a ridiculous question, but how do you return a list in scheme.? ...
Okay this may sound like a ridiculous question, but how do you return a list in scheme.? ...
Okay one of my homework problems is to take a list of lists and return the car of each sublist as a list. I have it to where I can print out the values, but it's not a list. To be honest, I have no clue how to output lists. Here's what I got: (define (car-print alist) (if (null? alist) (newline) (begin (write (car...
I have written JUnit tests for my class, and would like it to tell me if there is any part of my code that is not unit tested. Is there a way to do this? ...
Using two parameters to plot a line graph in C# using Visual Studio ( Using GUI). ...
What would be the smallest and largest number of comparisons in an unsorted array that could have duplicate elements as well ? I understand that finding anything in an unsorted array is a O(n) problem. But, is this true if the array contains duplicate elements as well ? By duplicate elements I mean, elements that occur more than once i...
I'm a writing a program that will determine the number of lines, characters, and average word length for a text file. For the program, the specifications say that the file or files will be entered as a command line argument and that we should make a TestStatistic object for each file entered. I don't understand how to write the code for ...
Write a function that returns the first non-repeating character in a string. Example: “Thanks for visiting" returns "h". ...
How can I write a Perl script that would scrape out sentences that mention 'Calvein Klein' in articles in a file named by $file? (Sentences can cross zero or more CR/LF characters.) I want to create an array of sentences scraped and print it at the end. ...
So I need to do a game of blackjack simulator, butt can't seem to figure out whats wrong with the shuffle it's suppose to take a card randomly from the pack the put it on top of the pack. The delete it from the rest. so : (ace)(2)(3)(4)(5)...(k) if random card is let say 5 (5)(ace)(2)(3)(4)(5)...(k) then it deletes the 2nd 5 (5)(ace)(2)...
I'm writing software to simulate the "first-fit" memory allocation schema. Basically, I allocate a large X megabyte chunk of memory and subdivide it into blocks when chunks are requested according to the schema. I'm using a linked list called "node" as a header for each block of memory (so that we can find the next block without tediou...
Hi all: This is uni homework so sorry about :my password protected url Please enter usersame as "uts" and password as "10479475", without the wrapper quotes. It it almost completed, please follow simple steps to see where my problem dwells: (preferably using Firefox, no IE6 welcomed :)) step1: click on any continent highlighted on w...
I can't figure out what would be the best way to use Bucket Sort to sort a list of strings that will always be the same length. An algorithm would look like this: For the last character position down to the first: For each word in the list: Place the word into the appropriate bucket by current character For each of the ...
I'm writing a program that for one part asks for the program to print how many characters (including whitespaces) are in a file. The code I have right now though returns 0 every time though and I'm not sure why it isn't counting the characters. public int getcharCount(Scanner textFile) { int count = 0; while(textFile.h...
i have written a program that prints out the integers in the same order as the input with 5 numbers per line. That is, the first 5 integers will be printed in the first line; the next 5 integers in the next line; andso on. and also i was trying to print out the numbers in a bar chart formatt:like 81-105 ( 1) x 56-80 ( 5) xxxxx 6-11(5) ...
Guys I know this question is silly but just to make sure: Having in my class method: boolean equals(Document d) { //do something } I'm overloading this method nor overriding right? I know that this or similiar question will be on upcoming egzam and would be stupid to not get points for such a simple mistake; ...
This C code is giving me some unpredictable results. The program is meant to collect 6 nos and print out the max, position of the max no and the average. It's supposed to have only 3 functions - input, max_avr_pos and output for doing what the code is supposed to do but I am getting unpredictable results. Please what could be the problem...
Here is my problem: Create a constructor for a telephone number given a string in the form xxx-xxx-xxxx or xxx-xxxx for a local number. Throw an exception if the format is not valid. So I was thinking to validate it using a regular expression, but I don't know if I'm doing it correctly. Also what kind of exception would I have to throw...
I help with my program. I am required to create a inverted pyramid of stars which rows depends on the number of stars the user keys, but I've done it so it does not give an inverted pyramid, it gives a regular pyramid. #include <stdio.h> #include <conio.h> void printchars(int no_star, char space); int getNo_of_rows(void); int main(void)...
I have a list called hand and another one called deck, the main goal here is to take the first card (or element ) in the list deck and put it in the list hand when i call the fnction draw... > (draw hand deck) (2 C) > (draw hand deck) (2 C) (3 H) > (draw hand deck) (2 C) (3 H) (K D) but everytime i call it the hand never changes valu...
Hi, I have to define an interface. The API in my homework is stated below: int generate_codes(char * ssn, char * student_id); int denotes 0 or 1 for pass or fail. studentid is an output param should return a 6 digit id. ssn is a 9 digit input param they school program will take ssn's and use my code to generate the student id. ...