Learning Java, How to output file "showing evidence of the program's required functionality" - Page 3 - Overclock.net - An Overclocking Community

Forum Jump: 

Learning Java, How to output file "showing evidence of the program's required functionality"

Reply
 
Thread Tools
post #21 of 65 (permalink) Old 11-27-2017, 12:22 AM - Thread Starter
New to Overclock.net
 
TheReciever's Avatar
 
Join Date: Nov 2009
Posts: 11,316
Rep: 434 (Unique: 322)
While reading your response I just realized I posted the method to do what I wanted lol

Im slappin my head a bit tonight xD

Thank you very much SpinFX!

My sleep cycle is overnight right now so I will be working on this for the rest of the night until around 9-10am CUS

Biased rPGA and MXM 3.0A/B Elitest.
TheReciever is offline  
Sponsored Links
Advertisement
 
post #22 of 65 (permalink) Old 11-27-2017, 01:32 AM - Thread Starter
New to Overclock.net
 
TheReciever's Avatar
 
Join Date: Nov 2009
Posts: 11,316
Rep: 434 (Unique: 322)
Updated OP with new problem

<3

EDIT:

I guess the problem was because of the project name. because inputdemo != AcceptingUserInput

I deleted the project a few times and tried a few names then realized when looking back at the helloworld project that it started with the "package helloworld" which is what the project is called as well.

I didnt know these items would be intertwined like that but now I know smile.gif

I do have one other questions though, I know, I am jumping the gun a bunch. Just know that I do sincerely appreciate the input you guys have provided thus far!



How can I get the last two boolean statements to appear on their own lines? I tried playing with %n and \n as well as print and println but I havent been able to strike gold on that particular experiment

Thanks!

Biased rPGA and MXM 3.0A/B Elitest.
TheReciever is offline  
post #23 of 65 (permalink) Old 11-27-2017, 07:47 AM
 
 
gonX's Avatar
 
Join Date: May 2006
Location: Odense, Denmark
Posts: 29,522
println stands for print line, so it will print a newline after its message. printf does not.
If you add ' \n ' to the end of the first argument of the printf statement on line 126 it should do what you want.

What does OCN offer as a site?
What are infractions and warnings?
How to make quality posts
#well
(19 items)
CPU
Intel Core i7 4770k
Motherboard
Gigabyte Z87X-UD4H
GPU
Sapphire RX 580
RAM
2x G.Skill F3-2400C10-8GTX
Hard Drive
Samsung 840 EVO
Optical Drive
Generic DVD±RW Burner
Power Supply
Corsair TX850
Cooling
Noctua NH-D14
Case
Fractal Design Core 2500
Operating System
Arch Linux
Monitor
Dell U2711
Monitor
Samsung SyncMaster 2233
Monitor
LG W2453TQ
Keyboard
Ducky DK9008G2, Cherry MX Blue, Overclock.net Edition
Mouse
Logitech G303
Mouse
Xtrfy GP3 HeatoN
Audio
Beyerdynamic DT-770 80 Ohm
Audio
AntLion ModMic v3
Audio
M-Audio Fast Track USB
▲ hide details ▲


gonX is offline  
Sponsored Links
Advertisement
 
post #24 of 65 (permalink) Old 11-27-2017, 07:53 AM - Thread Starter
New to Overclock.net
 
TheReciever's Avatar
 
Join Date: Nov 2009
Posts: 11,316
Rep: 434 (Unique: 322)
Would this be within the parentheses at the end ?

Biased rPGA and MXM 3.0A/B Elitest.
TheReciever is offline  
post #25 of 65 (permalink) Old 11-27-2017, 08:07 AM
 
 
gonX's Avatar
 
Join Date: May 2006
Location: Odense, Denmark
Posts: 29,522
No, this would be within the first argument. "\n%,.5f" would then be "\n%,.5f\n"

What does OCN offer as a site?
What are infractions and warnings?
How to make quality posts
#well
(19 items)
CPU
Intel Core i7 4770k
Motherboard
Gigabyte Z87X-UD4H
GPU
Sapphire RX 580
RAM
2x G.Skill F3-2400C10-8GTX
Hard Drive
Samsung 840 EVO
Optical Drive
Generic DVD±RW Burner
Power Supply
Corsair TX850
Cooling
Noctua NH-D14
Case
Fractal Design Core 2500
Operating System
Arch Linux
Monitor
Dell U2711
Monitor
Samsung SyncMaster 2233
Monitor
LG W2453TQ
Keyboard
Ducky DK9008G2, Cherry MX Blue, Overclock.net Edition
Mouse
Logitech G303
Mouse
Xtrfy GP3 HeatoN
Audio
Beyerdynamic DT-770 80 Ohm
Audio
AntLion ModMic v3
Audio
M-Audio Fast Track USB
▲ hide details ▲


gonX is offline  
post #26 of 65 (permalink) Old 11-27-2017, 08:26 AM - Thread Starter
New to Overclock.net
 
TheReciever's Avatar
 
Join Date: Nov 2009
Posts: 11,316
Rep: 434 (Unique: 322)
I have that in line 126 of the last screen shot though, unless I am missing something?

I want to break the line output between 126 and 128

Biased rPGA and MXM 3.0A/B Elitest.
TheReciever is offline  
post #27 of 65 (permalink) Old 11-27-2017, 09:45 AM
 
 
gonX's Avatar
 
Join Date: May 2006
Location: Odense, Denmark
Posts: 29,522
No, on line 126, your code says:
Code:
System.out.printf("\n%,.5f", 12345.56789);

It should say:
Code:
System.out.printf("\n%,.5f\n", 12345.56789);

Just to be clear, the issue is that your output says "12,345.56789true", right?

What does OCN offer as a site?
What are infractions and warnings?
How to make quality posts
#well
(19 items)
CPU
Intel Core i7 4770k
Motherboard
Gigabyte Z87X-UD4H
GPU
Sapphire RX 580
RAM
2x G.Skill F3-2400C10-8GTX
Hard Drive
Samsung 840 EVO
Optical Drive
Generic DVD±RW Burner
Power Supply
Corsair TX850
Cooling
Noctua NH-D14
Case
Fractal Design Core 2500
Operating System
Arch Linux
Monitor
Dell U2711
Monitor
Samsung SyncMaster 2233
Monitor
LG W2453TQ
Keyboard
Ducky DK9008G2, Cherry MX Blue, Overclock.net Edition
Mouse
Logitech G303
Mouse
Xtrfy GP3 HeatoN
Audio
Beyerdynamic DT-770 80 Ohm
Audio
AntLion ModMic v3
Audio
M-Audio Fast Track USB
▲ hide details ▲


gonX is offline  
post #28 of 65 (permalink) Old 11-27-2017, 10:08 AM - Thread Starter
New to Overclock.net
 
TheReciever's Avatar
 
Join Date: Nov 2009
Posts: 11,316
Rep: 434 (Unique: 322)
Well it's not a problem perse and the book I'm using didn't mention it at all but I figured there had to be a way to format it like that.

Thank you very much for sharing smile.gif

It's about time I slept but when I wake up ill be playing with the spacing more like you had shown me in your example

Biased rPGA and MXM 3.0A/B Elitest.
TheReciever is offline  
post #29 of 65 (permalink) Old 11-28-2017, 06:05 AM - Thread Starter
New to Overclock.net
 
TheReciever's Avatar
 
Join Date: Nov 2009
Posts: 11,316
Rep: 434 (Unique: 322)
Reciever here!

The book has begun with "Break Statements"

The book gives an example and the output should be as follows...

i = 0
i = 1
i = 2

It should break prematurely at 2 due to commands in line 10 and 11, but the result I get is in the screen shot below...



Would very much appreciate your guidance once more!

Thank you in advance!

EDIT: This is the example from the book
Code:
for (int i = 0; i < 5; i++)
{
System.out.println("i = " + i);
if (i == 2)
break;
}

Biased rPGA and MXM 3.0A/B Elitest.
TheReciever is offline  
post #30 of 65 (permalink) Old 11-28-2017, 06:41 AM
 
 
gonX's Avatar
 
Join Date: May 2006
Location: Odense, Denmark
Posts: 29,522
At the end of line 9 you're writing '1' and not 'i'

Maybe consider switching to a font that isn't stupid, like Source Code Pro

What does OCN offer as a site?
What are infractions and warnings?
How to make quality posts
#well
(19 items)
CPU
Intel Core i7 4770k
Motherboard
Gigabyte Z87X-UD4H
GPU
Sapphire RX 580
RAM
2x G.Skill F3-2400C10-8GTX
Hard Drive
Samsung 840 EVO
Optical Drive
Generic DVD±RW Burner
Power Supply
Corsair TX850
Cooling
Noctua NH-D14
Case
Fractal Design Core 2500
Operating System
Arch Linux
Monitor
Dell U2711
Monitor
Samsung SyncMaster 2233
Monitor
LG W2453TQ
Keyboard
Ducky DK9008G2, Cherry MX Blue, Overclock.net Edition
Mouse
Logitech G303
Mouse
Xtrfy GP3 HeatoN
Audio
Beyerdynamic DT-770 80 Ohm
Audio
AntLion ModMic v3
Audio
M-Audio Fast Track USB
▲ hide details ▲


gonX is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off