Grn Xtrm 84 Posting Pro in Training

I would use a stack. Stacks work in a "first in last out" manner, meaning the first value entered will be the last output. Start with the value at "size" (which is how big the stack is) and work your way down to position 0. This is just my interpretation, there are probably many other (and better) ways to accomplish this as Tom Gunn and firstPerson have already demonstrated.

Ps. Sorry if you already know about stacks and my post was completely boring =)

Grn Xtrm 84 Posting Pro in Training

Welcome to Daniweb.
My insatiable love of video games is what inspired me to take up computer science and learn about programming as well.
Good luck and great to have you aboard.

Grn Xtrm 84 Posting Pro in Training

Let it Happen by MxPx. Listen to that great bass intro.

Grn Xtrm 84 Posting Pro in Training

C can have some murky syntax, especially with output and format specifiers. Be sure to post any questions you may have in the C forum. There are many experienced members in this community who are always willing to help. Just show some effort and remember to use code tags! Keep at it. I'm sure you'll do fine.

Grn Xtrm 84 Posting Pro in Training

Welcome to Daniweb.
Keep at it. You won't become a good programmer without lots of practice and determination. I struggled with programming when I first started as well. Remember, Rome wasn't built in a day.
I look foward to working with you in the future.

Grn Xtrm 84 Posting Pro in Training

Welcome to Daniweb.
When I started college 2 years ago I too had very little experience with programming. Don't worry, after a few classes you'll get quite good at programming. Take your computer science classes seriously and always seek help if you are unsure of a particular topic. I look foward to reading your future posts.

Grn Xtrm 84 Posting Pro in Training

Music (bass guitar) geek
RPG geek
sit-com geek
Rock Band geek
Internet geek
Frog geek

Grn Xtrm 84 Posting Pro in Training

You can use Scanner objects to obtain user input for the values of x and y.
Try:

Scanner inputx = new Scanner(System.in);
Scanner inputy = new Scanner(System.in);
int x = inputx.nextInt();
int y = inputy.nextInt();

This should allow you to include user input in your program.
Is that what you are looking for?

Grn Xtrm 84 Posting Pro in Training

I'm not sure and Im not around a compiler right now. I would try breaking it up like you originally had. Try this:

import java.util.Scanner;
public class carpoolsavings {

	public static void main(String[] args) {
		
		double total;
		double distance = 200.00;
		double ppg = 2.79;
		double parking = 5.50;
		double tolls = .35;
		double mpg = 31.5;
		total = (distance / mpg * ppg + parking + tolls);
		System.out.println("Total Price is " + total );
	}
}

Also you don't need any scanner input so you can take that line out.

Grn Xtrm 84 Posting Pro in Training

I would try:
Make all of your variables of type double. Use println for output.

double total;
		double distance = 200.00;
		double ppg = 2.79;
		double parking = 5.50;
		double tolls = .35;
		double mpg = 31.5;
		System.out.println("Total Price is " + total );

Let me know if that works.

Grn Xtrm 84 Posting Pro in Training

There are a handful of tracks uploaded to the Downfall myspace page. There's a link to it posted on my Daniweb user profile.

I'm not a big fan of that kind of music but you guys sound really professional. Your drum beats are awesome as well. Keep up the good work!

Grn Xtrm 84 Posting Pro in Training

If you search for a javascript calculator in google, you'll find the code easily. Or you can actually try doing it yourself. The choice is your's.

Grn Xtrm 84 Posting Pro in Training

For B you have to put greater than 80 and less than 90.
Fix that for the other grades too.
The way you have it now, entering 90 will output all grades higher than F.
That should work.

Grn Xtrm 84 Posting Pro in Training

We meet up once a week for rehearsals (usually Sundays), but sometimes someone will come up with something on a Monday or a Tuesday and start the ball rolling....By the following weekend, we've usually got a rough demo of a complete new song and a new song to rehearse when we meet up for rehearsal!
So by the following rehearsal, we all know exactly what we'll be playing on the new track.

I can see where this would be very helpful. With this technique, you guys can go into rehersal already knowing your new songs. No need to waste time teaching everyone. Good stuff! By the way, is your band on any sites? I'd love to hear how you play.

Grn Xtrm 84 Posting Pro in Training

That sounds pretty complicated, and not exactly the best way to create music. Thanks for enlightening me with that info though.

Grn Xtrm 84 Posting Pro in Training

Hey, we've almost got enough people in this thread to start up an internet based all-geek band here on Daniweb!
Live gigs and rehearsals are probably out of the question (unless things go seriously viral...Yea' right!), but we might be able to cobble a few MP3 tracks together!
Anybody up for it?

I'm always up for playing music with other talented musicians.
Not quite sure how it would work without ever seeing each other though...??

Grn Xtrm 84 Posting Pro in Training

I like weekend mornings (Saturday and Sunday). No school to worry about. I just get to relax and do what I want.

Grn Xtrm 84 Posting Pro in Training

I play the bass guitar. I love to play classic songs from Iron Maiden, Journey, etc. I also play new stuff too. Playing solo now because I don't know anyone who wants to join a band. Check out my profile for a pic of my current bass. However I plan on buying a Paul McCartney style Hofner violin bass very soon.

Grn Xtrm 84 Posting Pro in Training

Dream Theatre has some good progressive metal, and includes other genres like jazz and such. I've never been a huge listener of them, as I prefer Tool's sound.

I like Schism by Tool. I can play the bass line which sounds so awesome.

Grn Xtrm 84 Posting Pro in Training

They were a boy band of their time, at least initially. Then the LSD and drugs kicked in and things moved off in a different direction.
Ahah, just because you don't like thrash metal... anyways. I never said the Beatles were bad. I like a lot of their stuff, but that doesn't negate the fact that they were a boy band, at least initially.

Yeah I'm not fond of thrash metal...Try Panic Attack by Dream Theater if you havent already heard it. That's about as metal as I get.:)

Grn Xtrm 84 Posting Pro in Training

I've always wondered, as a boy band, how did they ever gain such popularity?

And by the way Grn Xtrm, this song is also apparently on Rock Band too :P

The Beatles are not a boy band. They are all very talented musicians and songwriters. The Backstreet Boys and N SYNC are boy bands.

The Evile song must be a downloadable song because its not on the disc ... thankfully:D

Grn Xtrm 84 Posting Pro in Training

Thanks alot, that worked exactly as I wanted it.

Grn Xtrm 84 Posting Pro in Training

I'm really getting into the Beatles because of the new Rock Band game. My favorites are Here Comes the Sun, I Want to Hold Your Hand, and Ticket to Ride.

Grn Xtrm 84 Posting Pro in Training

Hello friends. I'm very new to C and am still learning how to do basic stuff. I got the code to work in C++ (which I'm much more fluent in) but I'm having trouble converting it to C code.

#include <iostream>
using namespace std;
double factorial( int n);
int main()
{
    cout<<"N          Factorial"<<endl;
    cout<<"--------------------"<<endl;
for(int i = 15; i>0; --i)
{
        cout<<i<<"          "<<factorial(i)<<endl;
}
char wait;
cout<<"enter";
cin>>wait;
return 0;
}

 double factorial( int n)      
{                                       
   double result = 1.0;
   for(  int i = 2; i <= n; ++i)
   result *= i;
   return result;
}

This is what I have for C:

#include <stdio.h>
#include <time.h>
#include <math.h>
double factorial (int num);
int main()
{
 printf("N          Factorial");
 printf("\n");
 printf("--------------------");
 printf("\n");
 int i;
for(i = 15; i>0; --i)
{
        printf("N %2.2f, factorial %2.2f \n" ,i,factorial(i));
        printf("\n");
}
char wait;
printf("Enter to exit");
scanf(&wait);

return(0);
}

 double factorial( int n)      
{                                       
   double result = 1.0;
   int i;
   for(  i = 2; i <= n; ++i)
   result *= i;
   return result;
}

This C code is not working properly. Can someone give me some ideas on how to resolve this. The problem is not with the factorial but more about style and format. I want the C program to have the same style as the C++ program.
Thanks for the help.

Grn Xtrm 84 Posting Pro in Training

"Fear of the Dark" and "Number of the Beast" by Iron Maiden.

Grn Xtrm 84 Posting Pro in Training

Thanks to all who have replied to this thread. I regret to inform you all that my friends lacked any sense of dedication to the band and have already given up. I will continue to play on my own until I am able to find more dedicated bandmates. If there is anyone who lives close to the Bronx, New York,and is a dedicated musician please let me know. Thanks again to everyone who spent time to read and reply to this thread.

Grn Xtrm 84 Posting Pro in Training


@OP : How didn't you come up with the name Green Extreme your login name sounds the same right ??? "Grn Xtrm"....;)

Grn Xtrm is short for Green Extreme. I just never thought to use it for a band name.

Grn Xtrm 84 Posting Pro in Training

Hello C, welcome to Daniweb. It's great to have a fellow musician in the community (I play bass). Enjoy your time here!

Grn Xtrm 84 Posting Pro in Training

Hello friends at Daniweb. Today I recieved my first Daniweb digest e-mail which implored people who have been members for many months to introduce themselves if they never had in the past. As I fall into this category, I would like to officially introduce myself now.

My name is Tom I am currently 20 years old, and I live in New York in the Uinted States. I have already posted in many forums including C++, Java, HTML and CSS, Geeks' Lounge, and others. I hope to be a game programmer after I complete my college degree in computer science. I am interested in music ( I play bass guitar), sports ( I love the Toronto BlueJays-- winning 7-0 as I type :) ), and video games.
Thanks for your time and I will continue to participate in every aspect of the community whenever I can!

Grn Xtrm 84 Posting Pro in Training

Hello and welcome to Daniweb. I love the video game Max Payne too. Can't wait to play Max Payne 3 coming this holiday season. Also, seeing as you live in Canada, I was just wondering if you are a fan of the Toronto Blue Jays. I live in America but they are my favorite baseball team.

Grn Xtrm 84 Posting Pro in Training

The scanner object from the Scanner class allows for interactive user input.

Grn Xtrm 84 Posting Pro in Training

Hi and welcome to Daniweb. Go to the Hardware and Software section, then go to Microsoft Windows and then Web browsers. I'm sure that you will find your answer there.

Grn Xtrm 84 Posting Pro in Training

Hi and welcome to Daniweb. Be sure to check out the web design sections of the web development forums (based on your post it seems that is what you are most interested in). I'm sure you will have much to add to the community.

Grn Xtrm 84 Posting Pro in Training

I play guitar (and occasionally drums) in the Praise team at our church.

Cool! I'm also a musician and into the world of compter science. I am 20 years old and have been playing bass for several years (although I'm into a slightly different kind of music ;) ). Rock on my friend!

Grn Xtrm 84 Posting Pro in Training

Listening to Panic Attack by Dream Theater. Trying to play this song without a 6 string bass.

Grn Xtrm 84 Posting Pro in Training

The top of the stack is -1 when the stack is empty. When you fill it using push(), the top will change. A return value of -1 lets the user know that the stack is empty.

Grn Xtrm 84 Posting Pro in Training

I coded for my object oriented design with Java final today. :S Mostly dealt with objects from the Collection heirarchy. I think I did pretty well.:)

Grn Xtrm 84 Posting Pro in Training

Many thanks, it worked just as I wanted it to!

Grn Xtrm 84 Posting Pro in Training

You might want to listen to the old Jello Biafra routine "Names For Bands" to get yourself rolling down some hilarious verbal alleyways.

We are not really looking for anything that explicit but I will definitely take your suggestion. Thanks for the reply.

Grn Xtrm 84 Posting Pro in Training

Perhaps a name not referring to food or drink. :P
I like the idea for Green Extreme too, sounds good.

LOL. Yeah I also noticed that our names focus on food and drink. I personally don't like acronyms. Thanks for your link and reply.

Grn Xtrm 84 Posting Pro in Training

How about your an expansion of your username itself - Green Extreme, it would do more than just cause a stir especially in these days of Global Warming concerns.

What say ?

Hey that's not bad at all. It's catchy and has deeper meaning. I will definitely suggest that one to the rest of the band. Thanks!

Grn Xtrm 84 Posting Pro in Training

Hey guys, I need your help with a very important matter. I'm starting a band with some of my friends from high school and we are odds in selecting a name for the band. My friend Ed wants the name to be Chicken N' Lamb (don't ask) while my brother Pete wants the name to be MILK( acronym for My Intelligence lacks knowledge ---- this was before the Sean Penn movie was released). If the esteemed members of DaniWeb could provide me with some unique and interesting band names I would be forever grateful. Thanks.

ahihihi... commented: MILK?.. nice meaning :twisted: +1
Grn Xtrm 84 Posting Pro in Training

Hello friends, I want to clear a table by clicking a button on a form. I have created the query to clear the table but I cannot make it the source for the command button on the form. Is this possible? Thanks for your time and help.

Grn Xtrm 84 Posting Pro in Training

Aces High by Iron Maiden. I almost got the bass line down perfectly.

Ezzaral commented: Excellent song! +21
Grn Xtrm 84 Posting Pro in Training

Sorry, I followed your first piece of advice and got the sum to display. Thanks alot for the help.

Grn Xtrm 84 Posting Pro in Training

Thanks for the reply but I need to use recursion (i.e. the function has to call itself) to solve this problem.

Grn Xtrm 84 Posting Pro in Training

Hello friends, I'm working on a program that takes a number input from the user and recursively sums the number 'n' to one. For example, inputting a 5 would sum 1/5 + 1/4 + 1/3+ 1/2 + 1/1. I have sucessfully gotten the fraction sequence to display but I am having trouble with the sum.
Here is my client program

#include "Fraction.cpp"
#include<iostream>
using namespace std;
Fraction SumOfSeries(int n);//adds fractions from num to 1
int main()
{
    int num;
    cout<<"Enter a number: ";
    cin>>num;
    cout<<"Sum of Series-> ";
    SumOfSeries(num);
    char wait;
    cout<<"\nEnter any key to end ";
    cin>>wait;
    return 0;
} 
Fraction SumOfSeries(int n)
{
    Fraction base(1,1);
    Fraction temp(1,n);
    if(n==1)
            {
                       base.Display();
                       return base;
            }
    else
        {
            for(int i=1; i<=n; i++)
            {
            base=base+temp;
            temp.Display();
            if(i!=n)
            cout<<" + ";
            return temp+SumOfSeries(n-1); 
            } 
        }      

}

Here is my fraction class (you probably don't need to spend too much time looking at this.

#include <iostream>
using namespace std;
class Fraction
{public:
        Fraction();
        Fraction(int n, int d);
        void Assign(int n, int d);
        Fraction Recip();
        void Display();
        int GetNum();
        int GetDen();
        double Convert();
        Fraction operator+(Fraction f);
        Fraction operator*(Fraction f);
        Fraction operator-(Fraction f);
        Fraction operator/(Fraction f);
        bool operator>(Fraction f);
        bool operator<(Fraction f);
        bool operator==(Fraction f);
        void Reduce();
        int GCF();
        friend ostream&operator<<(ostream&outs, const Fraction f);
        
 private:
        int num, den;
 };

Fraction::Fraction()
{}
                
void Fraction::Assign(int n,int d)
{
     num=n;
     den=d;
}
void Fraction::Display()
{
     cout<<num<<"/"<<den;
}
Fraction Fraction::Recip()
{
         Fraction temp(den,num);
         return temp;
}
int Fraction::GetNum()
{
    return num;
}
int Fraction::GetDen()
{
    return den; …
Grn Xtrm 84 Posting Pro in Training

Javascript is used in web programming to create dynamic, interactive pages. I think every half way advanced site includes javascript.

Grn Xtrm 84 Posting Pro in Training

I've been listening to amatuer bands covering Don't Stop Believing by Journey on youtube. Most of them are pretty weak, but it is a tough song to play.

Grn Xtrm 84 Posting Pro in Training

My hometown of Bronx, New York would be devestated. New York was one of the primary targets of the attack, so no surprise there. Let's hope this situation never becomes a reality.