I really need help with this so if anyone can help me out that wouldbe really great of you.

A

adityagaddam90

I am a student studying in college this is my first year and i am
taking Computer Science as my Major but i am having a hard time with
my course. I have no idea of whats going on in class so if any 1 knows
anything about this things i have to do please help me out.

the professor gave us this to do and i am having some trouble with
this so plz help me out on what to do here.

Part I

Write a program that prints the following pattern:

*
***
*****
*******
*****
***
*

Part II

To make a profit a local store marks up the prices of its items by
25%. Write a Java program that declares the following variables:
1. a double variable named percent_markedup
2. a double variable named original_price
3. a double variable named sales_tax_rate


In your program be sure to assign a value to each of the variables 1-3
above. Use initialization for 1 and 2 and for 3.

Using the information from above, the program should then output:
1. the original price of the item
2. the marked-up percentage of the item (original price times percent
of markup)
3. the store's selling price of the item
4. the sales tax rate
5. the sales tax
6. the final price of the item (the final price of the item is the
selling price plus the sales tax)



can u send me an email or using this to communicate. My email is
(e-mail address removed). thx a lot
 
P

Patricia Shanahan

I am a student studying in college this is my first year and i am
taking Computer Science as my Major but i am having a hard time with
my course. I have no idea of whats going on in class so if any 1 knows
anything about this things i have to do please help me out.

the professor gave us this to do and i am having some trouble with
this so plz help me out on what to do here.

See http://home.earthlink.net/~patricia_shanahan/beginner.html for my
advice on this situation.

Patricia
 
A

Andrew Thompson

 I am a student studying in college this is my first year and i am
taking Computer Science as my Major but i am having a hard time with
my course. I have no idea of whats going on in class so if any 1 knows
anything about this things i have to do please help me out.

the professor gave us this to do and i am having some trouble with
this so plz help me out on what to do here.

...can u send me an email

No this is not a helpdesk, it is a public forum.
And can you please take more effort to spell words fully?
..or using this to communicate. My email is
(e-mail address removed).

'You have spam!' It is best not to post your email
address clearly on the internet, but I suppose for a
GG poster, it makes little difference.
 
M

Mark Space

I am a student studying in college this is my first year and i am
taking Computer Science as my Major but i am having a hard time with
my course. I have no idea of whats going on in class so if any 1 knows
anything about this things i have to do please help me out.

I'm just curious: is this your first programming class ever or are you
taking a second or later course now?

Patricia gave pretty good advice. The only things I would add are:

1. Talk to your professor during office hours, or just before or just
after class. You may not be the only one having these problems.

2. Go to your computer lab and ask the assistants. Often, that's why
they are there. If not (they can't or won't help you), try to find out
if there's a lab with assistants who are available for instruction.
 
D

Daniel Pitts

I am a student studying in college this is my first year and i am
taking Computer Science as my Major but i am having a hard time with
my course. I have no idea of whats going on in class so if any 1 knows
anything about this things i have to do please help me out.

the professor gave us this to do and i am having some trouble with
this so plz help me out on what to do here.
[snip problem descriptions]

can u send me an email or using this to communicate. My email is
(e-mail address removed). thx a lot

My suggestion to you is to post what you've already tried, and what went
wrong with it. We won't do your homework for you here, but many of us
will help you understand it and make it happen.
 
A

adityagaddam90

I'm just curious: is this your first programming class ever or are you
taking a second or later course now?

Patricia gave pretty good advice. The only things I would add are:

1. Talk to your professor during office hours, or just before or just
after class. You may not be the only one having these problems.

2. Go to your computer lab and ask the assistants. Often, that's why
they are there. If not (they can't or won't help you), try to find out
if there's a lab with assistants who are available for instruction.

yes this is my first programming class ever.
 
A

adityagaddam90

I am a student studying in college this is my first year and i am
taking Computer Science as my Major but i am having a hard time with
my course. I have no idea of whats going on in class so if any 1 knows
anything about this things i have to do please help me out.
the professor gave us this to do and i am having some trouble with
this so plz help me out on what to do here.

[snip problem descriptions]


can u send me an email or using this to communicate. My email is
(e-mail address removed). thx a lot

My suggestion to you is to post what you've already tried, and what went
wrong with it. We won't do your homework for you here, but many of us
will help you understand it and make it happen.

hey Daniel like you have said i tried doing this for part 1 and i
didnt get it right so can u tell me what i have done wrong here.

public class Stars
{
public static void main(string [] args)
{
System.out.println( * );
System.out.println( *** );
System.out.println( ***** );
System.out.println(*******);
System.out.println( ***** );
System.out.println( *** );
System.out.println( * );
}
}
 
S

Stefan Ram

*
***
*****
*******
*****
***
*

public class Main
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println
( java.lang.String.format
( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}

*
***
*****
*******
*****
***
*
 
P

Patricia Shanahan

Stefan said:
*
***
*****
*******
*****
***
*

public class Main
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println
( java.lang.String.format
( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}

*
***
*****
*******
*****
***
*

This seems just a little bit more subtle in its use of advanced features
than I would recommend for the OP's current situation.

Patricia
 
P

Patricia Shanahan

hey Daniel like you have said i tried doing this for part 1 and i
didnt get it right so can u tell me what i have done wrong here.

public class Stars
{
public static void main(string [] args)
{
System.out.println( * );
System.out.println( *** );
System.out.println( ***** );
System.out.println(*******);
System.out.println( ***** );
System.out.println( *** );
System.out.println( * );
}
}

String literals in Java are enclosed in " marks:

System.out.println("Some string");

Patricia
 
A

adityagaddam90

(e-mail address removed) wrote:

...


hey Daniel like you have said i tried doing this for part 1 and i
didnt get it right so can u tell me what i have done wrong here.
public class Stars
{
public static void main(string [] args)
{
System.out.println( * );
System.out.println( *** );
System.out.println( ***** );
System.out.println(*******);
System.out.println( ***** );
System.out.println( *** );
System.out.println( * );
}
}

String literals in Java are enclosed in " marks:

System.out.println("Some string");

Patricia

thank you i will try that and see if it works
 
L

Lew

Not just the assistants. If you have an on-campus lab, just hang out there.
Take a look around for a few days. Stay low key. Pay attention to who else
is there all the time. See who attracts advice-seekers, and how they react to
supplicants.

When you start asking questions in that room, don't start with the gurus. Ask
the other supplicants - find out what they learned from the masters. Ask them
how they plan to use their new-found wisdom. Ask them for advice with your
problem.

Yes, the other seekers. The masters will respect you more when you finally do
approach them. Also, the insight of your fellow students who are at about the
same stage as you is worth more than you might think, as will your own insight
be when stimulated by your fellows.

Don't be too shy about approaching the masters - if they didn't want to answer
questions they'd hang out somewhere else.

As to the "stars" problem, a popular one, it seems, forget programming at
first and concentrate on logic. Look for repetitions, things that happen over
and over again, perhaps with a different number of stars or spaces each time.
It's much more important to understand the fundamental logic of the problem
than how to program it.
 
A

adityagaddam90

public class Main
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println
( java.lang.String.format
( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}
*
***
*****
*******
*****
***
*

This seems just a little bit more subtle in its use of advanced features
than I would recommend for the OP's current situation.

Patricia

Hey Patricia it worked thank you so much and all others who helped me
too. I am having problem with the part 2 do you think you can help me
out on how to start out with.

Part II

To make a profit a local store marks up the prices of its items by
25%. Write a Java program that declares the following variables:
1. a double variable named percent_markedup
2. a double variable named original_price
3. a double variable named sales_tax_rate


In your program be sure to assign a value to each of the variables 1-3
above. Use initialization for 1 and 2 and for 3.

Using the information from above, the program should then output:
1. the original price of the item
2. the marked-up percentage of the item (original price times percent
of markup)
3. the store's selling price of the item
4. the sales tax rate
5. the sales tax
6. the final price of the item (the final price of the item is the
selling price plus the sales tax)
 
S

Stefan Ram

Patricia Shanahan said:
This seems just a little bit more subtle in its use of advanced features
than I would recommend for the OP's current situation.

Several years ago, I have created a web page with exercise
regarding loops.

First, pupils are supposed to draw a line,
whose length is given as input to the program.

An example for a run of the program is given as follows.

length? 20

********************

Next, I try to make them invent nesting of loops
(which was not mentioned in the class so far):

width? 17
height? 4

*****************
*****************
*****************
*****************

After some other exercises, comes exactly the same figure as
in the OP, but with a »height« and width-change specified as
input to the program at run time:

height? 4
increment? 1

*
***
*****
*******
*****
***
*

And the final exercise is an ellipse:

half height? 11
half width? 31

********************
********************************
****************************************
**********************************************
****************************************************
******************************************************
**********************************************************
************************************************************
************************************************************
**************************************************************
**************************************************************
**************************************************************
**************************************************************
************************************************************
************************************************************
**********************************************************
******************************************************
****************************************************
**********************************************
****************************************
********************************
********************

This usually is too hard for the pupils at this level, but
there sometimes might be pupils who are exceptionally gifted
and want more difficult exercises.

( The URI of my German langauge with those exercises is as follows.

http://www.purl.org/stefan_ram/pub/programmieren_aufgabe_iteration_de

)
 
P

Patricia Shanahan

Hey Patricia it worked thank you so much and all others who helped me
too. I am having problem with the part 2 do you think you can help me
out on how to start out with.

Work step-by-step through the instructions, doing each thing you are
told to do. Pay attention to the other advice you have received about
using your professor, teaching assistants etc.

I can't help you directly with this, because you have given me nothing
to go with.

Patricia
 
A

adityagaddam90

(e-mail address removed) wrote:

...


Work step-by-step through the instructions, doing each thing you are
told to do. Pay attention to the other advice you have received about
using your professor, teaching assistants etc.

I can't help you directly with this, because you have given me nothing
to go with.

Patricia

ok well thx for at lest helping me out with something.
 
L

Lew

ok well thx for at lest helping me out with something.

How very gracious. Except for that "at least" part - it actually sounds
rather sulky.

You have received excellent advice, particularly from Patricia, who has given
you the keys to excel in your course. I should think you'd be exulting with
gratitude, most especially toward her.

Please avoid textspeak in Usenet posts.
 
M

Mark Space

Hey Patricia it worked

*whoosh*

And the point goes flying over your head, I'm sorry to have to say.

These programs look a bit rough actually for a first class. Maybe
there's some parts of the lecture that will discuss these issues still
to come?

The first part of Part II should be easy to get though, try to get at
least that much.
 
W

Wildemar Wildenburger

Stefan said:
*
***
*****
*******
*****
***
*

public class Main
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println
( java.lang.String.format
( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}

*
***
*****
*******
*****
***
*

Without any comment on why you wrote it that way, this is quite
dangerous, me thinks. If the OP were to blindly copy and submit it (as
many beginners are tempted to), (s)he is bound to get into trouble for
it (if the tutors are worth their salt). Which just might discourage
her/him, unnecessarily.

/W
 
G

Gordon Beaton

Without any comment on why you wrote it that way, this is quite
dangerous, me thinks. If the OP were to blindly copy and submit it (as
many beginners are tempted to), (s)he is bound to get into trouble for
it (if the tutors are worth their salt). Which just might discourage
her/him, unnecessarily.

There is a long standing Usenet tradition of providing technically
correct but obfuscated, advanced or otherwise "unlikely" solutions to
homework questions.

It's something the OP needs to deal with, and is IMO an important part
of the learning process if he comes here with questions that show a
complete lack of effort to solve the problem himself.

/gordon

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,818
Messages
2,569,727
Members
45,676
Latest member
ManuelaHol

Latest Threads

Top