#I need help again with basic coding again guys

444 messages ยท Page 1 of 1 (latest)

stone basalt
#

pls help ๐Ÿ™‚

severe tangleBOT
#

โŒ› This post has been reserved for your question.

Hey @stone basalt! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

stone basalt
#

milk

#

and help

cosmic vortex
#

send the code you need help with

#

or ask a question

stone basalt
#

I have a assignemnt

#

here are the parameters etc

#

im very confused on the subject

#

so idk

#

it needs to do those things

cosmic vortex
#

Are you even allowed to name a non main method main

stone basalt
#

uuhhhhh

#

idk

#

it has to seem like im not cheating

#

i dont rlly understand

#

tbh

cosmic vortex
#

./run java

public class Main {

 public static int main() {return 1;} 
 public static void main(String[] args) {}
}
digital domeBOT
#

Your java(15.0.2) code ran without output @cosmic vortex

cosmic vortex
#

Nope you can't

#

So that's the first thing I'd change

stone basalt
#

idk im confused

#

oooooh

#

so the main method

#

cant be liek tyhat

#

i have to make another mthod inside of it>

#

buttt

#

it needs to contain 2 int

#

so

cosmic vortex
#

Sorry I was wrong you can name another method main

stone basalt
#

im confused

#

im confused

cosmic vortex
#

On what

#

Yes you need another main method

stone basalt
#

huh

#

i need to

#

do the things it says on the left side

cosmic vortex
#

One that is void and takes in String[]

stone basalt
#

huh

#

your killing me

#

laymans terms pls

#

als

#

also

#

wahts the line to inpout util scanner

cosmic vortex
#

When they say main method holds that doesn't mean change the parameter list

stone basalt
#

isnt it like

#

java.input.utilscanner

cosmic vortex
#

So actually your your question is asking you to create two variables inside the main method

stone basalt
#

or something

cosmic vortex
#

Not actually change the main method to take in two ints

stone basalt
#

NO my question is how to do the assignemnt

cosmic vortex
#

Yes I'm trying to help you with the question

#

Because you messed up on the first part

stone basalt
#

no no

#

oh

#

i just need to

#

be able to take in 2 int

cosmic vortex
#

Change the method back to what it was

#

String args etc

stone basalt
#

alr

cosmic vortex
#

All I wants you to do is create two variables in the main method that are ints

#

For the first bit

#

And yeah you do want to Scanner her for this

#

It would be java.util.Scanner

stone basalt
cosmic vortex
stone basalt
#

no

cosmic vortex
#

Good

stone basalt
#

dont i input it?

#

like

#

java.util.Scanner.input

#

or somethoing

#

idk

#

gimme one sec

cosmic vortex
#

Import the package? Yes

#

The package name itself is java.util.Scanner

#

Something tells me you're mixing up the keyword import into the actual package name

stone basalt
#

import java.util.Scanner;

#

this

#

yes

#

yes

cosmic vortex
#

Yes

stone basalt
#

and this

#

Scanner inputDevice = new Scanner (System.in);

cosmic vortex
#

Looks good

stone basalt
#

like this

cosmic vortex
#

Yep

stone basalt
cosmic vortex
#

It helps if you just copy and paste the code in discord

stone basalt
#

now how do i make the new methods

#

alr alr

cosmic vortex
#

It does look good though onto the last part

stone basalt
#

yeah

#

so how do i make those method

#

s

#

within the main method

cosmic vortex
#

A method is like a function right?

#

Like in math

stone basalt
#

yes

#

ig

#

idk

cosmic vortex
#

f(x)

stone basalt
#

lol

#

yes

cosmic vortex
#

So you don't create the method in the main method

#

You call it and it returns a value or does something

stone basalt
#

yeah a function inside of a function cant exsist

cosmic vortex
#

Technically it can but for this yeah

stone basalt
#

so where do i make it then

cosmic vortex
#

So create the method in the class, the same spot as where the main method is

stone basalt
#

but outside its brackets right

#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
    }
   public static void main(String[] args){
       
   }
}
#

like this

#

?

cosmic vortex
#
public class MainClass {

 public static void main(String[] args) {

 }
  // Your methods here
}
stone basalt
#

sooo

cosmic vortex
#

Look here

stone basalt
#

like i did?

cosmic vortex
#

See those 3 ``` at the top of my message

stone basalt
#

yes

cosmic vortex
#

Add them at the bottom too and the message becomes this:

stone basalt
#

where are those

#

on the kb

#

found em

#

grave

cosmic vortex
#

Nice

stone basalt
#

is that right tho

#

what i did

cosmic vortex
#

Your method is in the right spot just change the name and parameters

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
    }
   public static void displayTwiceTheNumber(String[] args){

   }
   public static void displayNumberPlusFive(String[] args){

   }
   public static void displayNumberSquared(String[] args){
       
   }
}
#

wym

#

ah yes

#

it cant be void right

#

it has to be return

#

or something

cosmic vortex
#

Well are they supposed to take in a String array?

stone basalt
#

int

#

i think

cosmic vortex
#

so change the parameter list to match that

stone basalt
#

so

#

int[] args

#

?

#

idek

cosmic vortex
#

Just int

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
    }
   public static void displayTwiceTheNumber(int){

   }
   public static void displayNumberPlusFive(int){

   }
   public static void displayNumberSquared(int){

   }
}
#

?

cosmic vortex
#

The parameter needs a name so you can reference it inside the method

stone basalt
#

what do i name it

#

1 2 3

#

?

cosmic vortex
#

You don't name it a value

stone basalt
#

letter

cosmic vortex
#

Give it a name like num or something

stone basalt
#

x

#

y

#

z

cosmic vortex
#

Sure ig

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
    }
   public static void displayTwiceTheNumber(int x){

   }
   public static void displayNumberPlusFive(int y){

   }
   public static void displayNumberSquared(int z){

   }
}
#

this

#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
    }
   public static void displayTwiceTheNumber(int x){
       int q;
       int w;

   }
   public static void displayNumberPlusFive(int y){
       int e;
       int r;

   }
   public static void displayNumberSquared(int z){
       int t;
       int u;

   }
}
#

like this maybe

cosmic vortex
#

Why

#

The whole point of a parameter is to declare the variable

stone basalt
#

im confused and stressed this is due at 11 tn

#

i have 25 minutes to understand the concept

cosmic vortex
#

So just like a function

#

f(x)

#

x is the parameter

stone basalt
#

ye

cosmic vortex
#

The parameter is given a value when called

#

For instance f(5)

stone basalt
#

no cause basically they have to multiply and stuff the values i give them tho

cosmic vortex
#

That value is passed into the function

stone basalt
#

so x represents the int values i put in for a and b in the main function?

cosmic vortex
#

For instance f(x) = x+5 -> f(5) = 5+5

#

Make sense?

#

This idea is directly translated into java methods

#
public class Main {

public static int f(int x) {
   return x+5;
}

}
#

do you see how this is working?

#

It's the exact same function but as a Java method

stone basalt
#

i was making int q

#

to give it a value of 2

#

to multiply by it

#

isnt that whats supposed to happen?

cosmic vortex
#

Yep and guess what. To call the method there is quite literally a 1 to 1 mapping

#

f(5);

#

this calls the method and returns the value

cosmic vortex
stone basalt
#

WAIT

#

how do i square a value

cosmic vortex
#

Math.pow(n, 2);

stone basalt
#

wat

#

i dont think i can use that

#

shell think im cheating

cosmic vortex
#

So just multiple it by itself

stone basalt
#

yes

#

ig

#

so

#

a.a

#

?

cosmic vortex
stone basalt
#

shit

#

right

#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
    }
   public static void displayTwiceTheNumber(int x){
       int q = 2;

   }
   public static void displayNumberPlusFive(int y){
       int e = 5;

   }
   public static void displayNumberSquared(int z){
       

   }
}
#

so

#

how do i import values

#

im runnign out of tim

cosmic vortex
#

Okay list

#

To call the method you need to write displayTwiceNumber(a); in main method

#

You pass in the value

#

That you want the method to use

#

And in your method you are displaying twice the number

#

So display 2*x

#

In displayTwiceNimber

stone basalt
#

so

#

i just write

#

2*a

#

2*b

#

?

cosmic vortex
#

You want to display it

stone basalt
#

no no

cosmic vortex
#

How do you print something in Java?

stone basalt
#

lookie

cosmic vortex
stone basalt
#

it has to be like this

cosmic vortex
#

Okay I see

stone basalt
#

so it wants me to call the method after it multiplies int a and b and then print it

cosmic vortex
#

So System.out.println(x + "times....

#

Fill in the rest

stone basalt
#

yes

cosmic vortex
#

To call each of the methods on the first input and the second input

stone basalt
#

System.out.println(a + "times" + b + "is" )

#

wait

#

so i do this

#

but

#

what do i put

#

for the final output

#

displayTwiceTheNumber?

cosmic vortex
#

x is your number

stone basalt
#

no

#

a is

cosmic vortex
#

Well you passed in the value in a

#

And that value is assigned to x

#

(that's how methods work)

stone basalt
#

i no understand

cosmic vortex
#

This is why we have parameters

#

Whenever you call a method, the value you send, even if it's a variable, is assigned to the parameter

#

It's like a new program has started basically and it doesn't know about a, only x because it's defined in the method

#

So x is the original value. Idk what b is but that should just be 2

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceNumber(a);
        displayTwiceNumber(b);
        System.out.println(a + " times 2 is " + );
        System.out.println(a + " plus 5 is " + );
        System.out.println(a + " squared is " +  );
        System.out.println(b + " times 2 is " + );
        System.out.println(b + " plus 5 is " + );
        System.out.println(b + " squared is " +  );

    }
   public static void displayTwiceTheNumber(int x){
       int q = 2;

   }
   public static void displayNumberPlusFive(int y){
       int e = 5;

   }
   public static void displayNumberSquared(int z){
       

   }
}
#

no

#

cause when it grades it right

cosmic vortex
#

Ahhhh

stone basalt
#

itll assign a dif value

#

to test if my methods work

cosmic vortex
#

Put your print statements in your new method

#

You are calling these methods and they are printing

#

Not the main method

stone basalt
#

so put them in their respective methods?

cosmic vortex
#

Yes

#

Methods are like groups of code

#

That you call to execute

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceNumber(a);
        displayTwiceNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
       int q = 2;
        System.out.println(a + " times 2 is " + x );
        System.out.println(b + " times 2 is " + x );
        x = a*q
        x = b*q
   }
   public static void displayNumberPlusFive(int y){
       int e = 5;
        System.out.println(a + " plus 5 is " + y );
        System.out.println(b + " plus 5 is " + y );

   }
   public static void displayNumberSquared(int z){
       System.out.println(b + " times 2 is " + z );
       System.out.println(b + " squared is " + z );

   }
}
#

like this or no

#

i only did that first one idk if its right

cosmic vortex
#

Yes

#

Almost

stone basalt
#

yeah?

#

whats missing

cosmic vortex
#

You don't need to declare any new variables in these methos

stone basalt
#

sooo

#

wait

#

i can do

#

2*a

cosmic vortex
#

Your parameters have everything you need

stone basalt
#

that works?????

cosmic vortex
#

Yes

#

Make sure when you do arithmetic, well, at least when adding that you put it in a parenthesis if it's in a print statement, also order of operations applies (hopefully that's obvious)

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceNumber(a);
        displayTwiceNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
        System.out.println(a + " times 2 is " + x );
        System.out.println(b + " times 2 is " + x );
        x = a*2;
        x = b*2;
   }
   public static void displayNumberPlusFive(int y){
        System.out.println(a + " plus 5 is " + y );
        System.out.println(b + " plus 5 is " + y );
        y = a+5;
        y = b+5;
   }
   public static void displayNumberSquared(int z){
       System.out.println(b + " times 2 is " + z );
       System.out.println(b + " squared is " + z );
        z = a*a;
        z = b*b;
   }

}
#

now im very confused whats wrong

cosmic vortex
#

just so it inline

stone basalt
#

what

cosmic vortex
#

You're confusing yourself by reassigning

#

You can do arithmetic expressions in a print statement

stone basalt
#

ah it wont import int a and int b

#

thats the problem

#

why not tho

cosmic vortex
#

Because I already said

#

You're working with x

#

Or y or z

stone basalt
#

im confused now

cosmic vortex
#

HOW

stone basalt
#

๐Ÿ˜ฆ

cosmic vortex
stone basalt
#

its due in 1 minute

#

im gonna get a zero on this

#

๐Ÿ˜ฆ

cosmic vortex
#

Then just change it x and stop asking questions lmao

stone basalt
#

CHANGE WUT TO X

cosmic vortex
#

A and B

stone basalt
#

x = x^2????

cosmic vortex
#

x * x

stone basalt
#

x = x*2

#

???

#

tell me how that makes sense

cosmic vortex
#

Inside the print statement

#

Stop

#

Don't reassign the damn variable lol

stone basalt
#

..

#

..

#

..

cosmic vortex
#

You have x in the print statements? Just replace it with x * x

#

It's that simple

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceNumber(a);
        displayTwiceNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
        System.out.println(a + " times 2 is " + x*2 );
        System.out.println(b + " times 2 is " + x*2 );
        x = a*2;
        x = b*2;
   }
   public static void displayNumberPlusFive(int y){
        System.out.println(a + " plus 5 is " + y+5 );
        System.out.println(b + " plus 5 is " + y+5 );
        y = a+5;
        y = b+5;
   }
   public static void displayNumberSquared(int z){
       System.out.println(b + " times 2 is " + z*z );
       System.out.println(b + " squared is " + z*z );
        z = a*a;
        z = b*b;
   }

}
#

like this

#

??

cosmic vortex
#

Why do you a

#

Why do you have b

stone basalt
#

:/

cosmic vortex
#

Replace It with x y or z

stone basalt
#

how does it knoooooow

#

what im talking abt

cosmic vortex
#

Because you defined it

#

You passed the value in and it's assigned to x

stone basalt
#

BUT THERES 2 values

#

how does it know what to print

cosmic vortex
#

YES you called it twice

stone basalt
#

it can just repeat it

#

:/

cosmic vortex
#

Each time it assigns it to x and runs the code

stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceNumber(a);
        displayTwiceNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
        System.out.println(a + " times 2 is " + x*2 );
        System.out.println(b + " times 2 is " + x*2 );
        x = x*2;
        x = x*2;
   }
   public static void displayNumberPlusFive(int y){
        System.out.println(a + " plus 5 is " + y+5 );
        System.out.println(b + " plus 5 is " + y+5 );
        y = y+5;
        y = y+5;
   }
   public static void displayNumberSquared(int z){
       System.out.println(b + " times 2 is " + z*z );
       System.out.println(b + " squared is " + z*z );
        z = z*z;
        z = z*z;
   }

}
#

lik this

cosmic vortex
#

You didn't change anything.....

#

You still have a

#

You still have b

#

In your method that are printing

stone basalt
#

AHHHH

#

it FUCKIN WORKED

#

but

#

not in the right order

#

:/

#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceTheNumber(a);
        displayTwiceTheNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
        System.out.println(x + " times 2 is " + x*2 );
        System.out.println(x + " times 2 is " + x*2 );
        x = x*2;
        x = x*2;
   }
   public static void displayNumberPlusFive(int y){
        System.out.println(y + " plus 5 is " + y+5 );
        System.out.println(y + " plus 5 is " + y+5 );
        y = y+5;
        y = y+5;
   }
   public static void displayNumberSquared(int z){
       System.out.println(z + " times 2 is " + z*z );
       System.out.println(z + " squared is " + z*z );
        z = z*z;
        z = z*z;
   }

}
#

NO IT DIDNT WORK

#

I TROLD YOU

cosmic vortex
#

Okay you do realize that code runs one line at a time right

stone basalt
#

it repeated a

#

twice

#

TWICE

cosmic vortex
#

You only need one print statement in the entire method for each

stone basalt
#

look

cosmic vortex
#

I didn't see that but yeah that's a big blunder loll

#

You only need one print statement

#

Listen

#

A method is a task

#

When you call a method you are telling it to print something twice by having two print statements

#

That's what you just did

#

Does that make any sense?

stone basalt
#

NO

#

im dumb

cosmic vortex
#

A METHOD IS A THING THAT DOES SOMETHING

stone basalt
#

YES

#

f(x)

cosmic vortex
#

does that not make sense?!

stone basalt
#

YES

cosmic vortex
#

YES

#

You said method PRINT PRINT

#

So it's going to PEINT PRINT

stone basalt
#

it mostly works

#

but listen

#

it

#

says

#

5+5

#

55

#

=

#

55

#

tell me

#

how fix

cosmic vortex
stone basalt
#
import java.util.Scanner;
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceTheNumber(a);
        displayTwiceTheNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
        System.out.println(x + " times 2 is " + x*2 );
        
        x = x*2;
       
   }
   public static void displayNumberPlusFive(int y){
        System.out.println(y + " plus 5 is " + y+5 );
       
        y = y+5;
   }
   public static void displayNumberSquared(int z){
       System.out.println(z + " squared is " + z*z );
       
        z = z*z;
   }

}
#

oh shit

#

naw

#

still deosnt work

cosmic vortex
#

Wdym โ˜ ๏ธ

stone basalt
#

nbm

#

nvm

#

i put this y +(5)

#

im a dumbass

#
public class NumbersDemo{
    public static void main(String[] args){
        int a;
        int b;
        Scanner inputDevice = new Scanner (System.in);
        System.out.println("Enter an integer >> ");
        a = inputDevice.nextInt();
        System.out.println("Enter another integer >> ");
        b = inputDevice.nextInt();
        displayTwiceTheNumber(a);
        displayTwiceTheNumber(b);
        displayNumberPlusFive(a);
        displayNumberPlusFive(b);
        displayNumberSquared(a);
        displayNumberSquared(b);
    

    }
   public static void displayTwiceTheNumber(int x){
        System.out.println(x + " times 2 is " + x*2 );
        
        x = x*2;
       
   }
   public static void displayNumberPlusFive(int y){
        System.out.println(y + " plus 5 is " + (y+5) );
       
        y = y+5;
   }
   public static void displayNumberSquared(int z){
       System.out.println(z + " squared is " + z*z );
       
        z = z*z;
   }

}
cosmic vortex
#

Okay in programming if I do
a = 8
print a
And that a = 6

#

DO YOU THINK IT'S GOING TO MAGICALLY PRINT 6?????

#

It's going to print 8

stone basalt
#

tyyyyy

cosmic vortex
#

Okay good job

stone basalt
#

uhhhh

#

yes>

#

?

cosmic vortex
#

No

#

Print a first

stone basalt
#

man

#

i need

#

a

cosmic vortex
#

It's going to print it's value

stone basalt
#

java basics class

#

even tho thats what im in

#

LOL

cosmic vortex
#

Code runs in a sequential manner

#

If you print the value it's going to print it's present value

#

Reassigning it later isn't going to change the print

#

Because it already happend

stone basalt
#

hey man

#

i hope you know

#

ill be back next tuesday night crying about more assignments that i dont know how to do

cosmic vortex
#

Please learn how methods work

#

Your brain will thank you

stone basalt
#

dw

#

you can teach me sir

cosmic vortex
#

f(x) !!!

stone basalt
#

wait

#

i think i understand

#

methods are like functions

#

like

#

a piecewise

#

I can

#

give it inputs from the main function

#

or main method in this case

#

and it can run them and return values to the main method

#

or it can keep the values and in this case print them

#

or graph them in math

#

yes?

#

but i cant directly use variables through the main function

#

i have to define them through in my case x

thorny cobalt
#

i need help with creating a website

winter island
winter island