homework

problem using file.seekp

i'm trying to write to append data to the end of a file, and am using the seekp(streamoff off, ios_base::seekdir dir) function but it doesn't append, somehow it writes the data in the middle of the file. i tried adding opening the file like this - file.open(resultFile,fstream::in|fstream::out); (as was suggested in other similar posts) t...

Need help with some Oracle SQL Queries

Here is the question posed by a professor: Find the minimum and maximum length of movies playing in each city. And here is how I have my tables structured: CREATE TABLE Theatres ( Name varchar2(50) not null, City varchar2(50) not null, State varchar2(50) not null, Zip number not null, Phone varchar2(50) not null, PRIMARY KEY (Name) ); ...

Follow-Up Help with a SQL Query

I asked something similar a few days ago, here is my issue. My professor has phrased the following question: Find the average ratings of all movies playing at each theatre. Display the theatre name and the computed rating. Order the results ascending by rating. Here is how my tables are structured: CREATE TABLE Theatres ( Name var...

ORACLE SQL Statement

So I need help modifying my query to not just include one movie from each city, but all movies from each individual city. Here is my professor's question: Find the average rating of all movies playing in each city. Display the city name and the computed rating. Order the results descending by rating. Here is my definition for each tabl...

Oracle SQL Question

So I've been doing this all night - can't quite understand my homework, and sadly my professor is unavailable on the weekend. Here it goes: Find the titles of the newest movies shown in each city. Display the city name and the newest movie title ordered by city name and movie title. Here are my table declares (and thank you to EVERYONE...

Comparator problem - Java

Hey guys, Quite new to Java so this is probably pretty straight forward. I want to sort an ArrayList in the class MediaLib based on the natural order of a specified key. I cant work out how to use my comparator (compareTo(MediaInterface, key)) which is in the Media class. Whats the best way to go about this? package assign1; import ja...

Basic Issues with Linked Lists

I'm working on a homework assignment for CS1, and I almost have it finished but errors keep popping up in relation to a few functions I've tried to implement. The assignment is the classic addition and subtraction of big integers using linked lists. My issue isn't with any of mathematical functionality of the program, but rather getting ...

Oracle SQL Question - Need Help

So I've been doing this all night - can't quite understand my homework, and sadly my professor is unavailable on the weekend. I've posted a few of these questions, this being the last one. I've got something to go on, but it needs working (and coming out of this I'd love to fully understand the answer so I don't need help on something ...

Adding and Subtracting Bigints Using Linked Lists

I'm almost done with this assignment, and it's killing me. This is my THIRD post about three different sections of this, and I'm honestly embarrassed that I'm struggling this much with the assignment. The assignment itself is to make a program that performs addition and subtraction of big integers using linked lists (and I'm slowly star...

Converting strings to uppercase and using char at method

i need to convert the first letter of a string of names to uppercase and using the charat method but not sure how to use the char at method ...

Converting a char to uppercase

String lower = Name.toLowerCase(); int a = Name.indexOf(" ",0); String first = lower.substring(0, a); String last = lower.substring(a+1); char f = first.charAt(0); char l = last.charAt(0); System.out.println(l); how would i get the F and L variables converted to uppercase. ...

Function Balanced one or more parentheses

I want to define function called Balanced that takes string containing parentheses and returns true if the parentheses in this string are Balanced and False if not In Haskell Please ...

Replacing a letter in a string with a char

String lower = Name.toLowerCase(); int a = Name.indexOf(" ",0); String first = lower.substring(0, a); String last = lower.substring(a+1); char f = first.charAt(0); char l = last.charAt(0); f = Character.toUpperCase(f); l = Character.toUpperCase(l); String newname = last +" "+ first; System.out.println(newname); i want to take variables...

Calculating check digit for ISBN

This isn't actually homework, I'm just looking through some questions in a discrete maths book before I start computer science next week. Anyway, one of the questions asks me to write a program to perform this algorithm (which it explains). The part I'm stuck with is how to take the 9 digit number and "split" it into single integers, so...

Java - Swapping Values and Keys in one Map?

I am making an encrypt and decrypt program for my programming class, however I am a year ahead of the group so I thought I'd simplify things by using what I learned last year. I decided to use a Tree Map. What the program does is it takes in a file, reads the first line which contains the encrypt data of how the letters will be coded. It...

How can I send an HTTP Response using only standard network libraries?

Hey gang, I'm working on my first homework project in a web programming class, which is to write a simple web server in Java. I'm at the point where I have data being transmitted back and forth, and to the untrained eye, my baby server seems to be working fine. However, I can't find a way to send appropriate responses. (In other words, ...

Parsing a text file in Java

Example from input file: ARTIST="unknown" TITLE="Rockabye Baby" LYRICS="Rockabye baby in the treetops When the wind blows your cradle will rock When the bow breaks your cradle will fall Down will come baby cradle and all " The Artist, Title & Lyrics fields have to be extracted to their respective Strings with captalization and format ...

Find all string "the" in in .txt file.

here is my code // Import io so we can use file objects import java.io.*; public class SearchThe { public static void main(String args[]) { try { String stringSearch = "the"; // Open the file c:\test.txt as a buffered reader BufferedReader bf = new BufferedReader(new FileReader("test.txt"...

matlab problem in plotting a function

I have 2 functions: f (aa) = 9 sinaa/aa + cosaa for 0 <= aa <= 6pi. --- >equation 1. and f(aa) = cosku I need to plot the allowed values of aa which will satisfy the equation 1. How do i do this i matlab? ...

Can anyone help me check where is my problem?

Question as bellow: Write a program to implements an interview scheduler. These are the requirements for the interview scheduler: A prompt asks the executive secretary to input the time for the first interview, and then a loop continues to prompt for input of subsequent interview, and then a loop continues to prompt for input of subse...