[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

Archived threads in /g/ - Technology - 3138. page


File: java[1].jpg (107KB, 1280x768px) Image search: [Google] [Yandex] [Bing]
java[1].jpg
107KB, 1280x768px
Can someone help me with my code, I'm trying to create a simple calculator that asks for user input, a value too low will return "no that number is too small try again" a value too large will return "no that number is too large, try again" and the correct answer will output "correct" while ending the program.

It's straightforward but I'm trying to get the hang of looping. It all works fine, but I want it to continuously accept inputs until the correct answer is reached.

i.e
PC: Answer '2 + 2' as an integer
User: 2
PC: "Incorrect, that number is too small. Try again."
User: 6
PC: "Incorrect, that number is too large. Try again."
User: 4
PC: "Correct!"
*ends program*


/*A program whereby the user is asked to solve 2+2,
every false answer reads "incorrect" and must
input another answer until the correct answer is reached
*/

import java.util.Scanner;

public class muckabout {

public static void main(String[] args) {

try(Scanner input = new Scanner(System.in)) {
String question = "Answer '2 + 2' as an integer";
System.out.println(question);
int intIn = input.nextInt() ;

if (intIn < 4) {
System.out.println("That number is too small, try again.");

}
if (intIn > 4) {
System.out.println("That number is too large, try again.");
}

if (intIn == 4) {
System.out.println("Correct, congratulations!");
}

}
}
}

Also how do I format the code for the /g/ board thanks in advance.
22 posts and 1 images submitted.
>>
>>51660300
consider assisted suicide.
>>
A calculator will never tell you that a number is too small or too big or correct.

Go best up a white nerdy kid to do your homework, Jamal
>>
>>51660300
First off why the fuck are you using a string to input into System.out.println and not directly in it?
Secondly, you want to make a procedure so first have a main method with the void in it like
public static void main(String[] args)
{
for (int i = 1; i < 5; i++)
calc();
}
//calculator shit goes here
Now this is probably incorrect because I need to test it but the general idea is there

File: 1448809235772.jpg (279KB, 1270x1367px) Image search: [Google] [Yandex] [Bing]
1448809235772.jpg
279KB, 1270x1367px
>How to request purchase advice:
http://pastebin.com/hjHkKDyM
>/g/ wiki headphone FAQ:
https://wiki.installgentoo.com/index.php?title=Headphones
>Previous thread:
>>51647693
333 posts and 48 images submitted.
>>
File: IMG_20151202_211803.jpg (259KB, 1040x780px) Image search: [Google] [Yandex] [Bing]
IMG_20151202_211803.jpg
259KB, 1040x780px
still trying to figure out which one i like more...............

the dt770 sounds super off when i start using it after long periods of time with the hd558s. i'm using a xonar DG to power them but that might be incorrect.

kinda wish i had an 80ohm pair :(
>>
>>51660311
>kinda wish i had an 80
yeah thats a bit of a problem
>>
>>51660232
Hi /hpg/
Poorfag here, but I need new hedphone
Are the Encore Rockmaster really the best value for this quality/price, or are these just hyped after the success of their crowfunding?
If they are bad, can you head me to another on ear closed and portable headphone at this price range?
I live in France and listen mostly to post punk
Thanks

Hey /g/ I have a problem
I have a javascript which I want to share on a forum, unfortunately the forum doesnt have any features to allow this and has a character limit.
Do any of you know of a website that will save javacode and run it when opened? I can share links in this forum so that was my first plan.
Any other options are appreciated.
11 posts and 1 images submitted.
>>
>>51660206
Then why do you have "Java" set as the subject?
Checkmate.
>>
Java is not Javascript, you filthy pleb.

If you don't even understand that, you're out of your league.

There are a number of websites that can display and execute JS code which are helpful for online, forum based debugging, but I'm not going to tell you them since you lured me here under false pretences claiming this was a JAva related question.

Google that shit.
>>
>>51660206
>hey guys, how do I cross-site scripting?

File: image.jpg (174KB, 750x873px) Image search: [Google] [Yandex] [Bing]
image.jpg
174KB, 750x873px
Hey bro can I use your computer?
44 posts and 12 images submitted.
>>
>>51660152
You make me sick, OP. Don't even fucking joke about that.
>>
>>51660152
http://m.youtube.com/watch?v=h1wBkNjTKgs
Gotta keep your gear clean m9.
>>
>>51660193
This is a true story though

File: LFS.png (48KB, 602x500px) Image search: [Google] [Yandex] [Bing]
LFS.png
48KB, 602x500px
what laptop are you using /g/?
29 posts and 5 images submitted.
>>
>>51660137
stupid penguinposter
>>
>>51660164

>2015
>not penguinposting
go
>>
None of your goddamn business.

File: front.jpg (73KB, 780x585px) Image search: [Google] [Yandex] [Bing]
front.jpg
73KB, 780x585px
who still uses a note 2 or S3 galaxy with CM ?
24 posts and 2 images submitted.
>>
Not me

So fuck off
>>
>>51659974
I had my S3 with slimkat 4.4.4 up until September.

It got too slow and I got a G4 for cheap.

It still works fine though.
>>
>>51659974
Anon-san , why are you so poor?

File: 232268544.jpg (152KB, 960x1280px) Image search: [Google] [Yandex] [Bing]
232268544.jpg
152KB, 960x1280px
I currently live in China and can't for the life of me access Tor. China Unicom blocks obfsproxy relays extremely well. I'm using an http proxy but it isn't doing any good. Can anyone help me with this? Will posts updates on advice to show if it works, thanks!
14 posts and 2 images submitted.
>>
Cool pic anon
>>
Trying to access sites or communicate? You can encrypt messages
>>
>>51659967
what city? chengdu?

File: hqdefault.jpg (38KB, 480x360px) Image search: [Google] [Yandex] [Bing]
hqdefault.jpg
38KB, 480x360px
What Linux OS should I use? I don't want to touch the command line and want a taskbar instead of a sidepanel.
24 posts and 3 images submitted.
>>
linux mint
>>
>>51659550
ElementaryOS
>>
Windows

File: vuze-01-.jpg (31KB, 600x433px) Image search: [Google] [Yandex] [Bing]
vuze-01-.jpg
31KB, 600x433px
Is Vuze the best torrent client?
23 posts and 5 images submitted.
>>
>>51659545
I like it
just werks
etc
>>
>>51659545
kill yourself f︂︂a︂m
>>
>>51659545
0/10 very shitty bait

File: or.webm (3MB, 1280x720px) Image search: [Google] [Yandex] [Bing]
or.webm
3MB, 1280x720px
Who has better framerates for this new tech?

Any recommended cards
48 posts and 6 images submitted.
>>
It's just rendering two images at once and applying a simple distortion to them. There's nothing about it that favours either side.
>>
>>51659361
Nvidia has less microstutter, which is important for this tech. Basically if it plays Fallout 4 on ultra then it should do well with oculus.
>>
>>51659361
if the game has horrible optimization then it doesn't really matter

You have 7 words or fewer to make Richard Stallman as angry as possible. What do you say?

Acronyms may count as 1 word.
88 posts and 10 images submitted.
>>
>>51659258
GNU is nothing without Linux
>>
File: 1386300190046.jpg (244KB, 826x1032px) Image search: [Google] [Yandex] [Bing]
1386300190046.jpg
244KB, 826x1032px
>>51659258
nothing to hide, nothing to fear!
>>
JUST

File: 1389253569524.jpg (271KB, 717x699px) Image search: [Google] [Yandex] [Bing]
1389253569524.jpg
271KB, 717x699px
ITT: we design a hypothetical image board.
61 posts and 18 images submitted.
>>
U18thchannel is down and pawsru is gone
Tgere needs to be a high traffic furry chan thats not all fetish shit and not all pron
>>
>>51659328
>furry
>>
That system is too hard for me desu

File: pS9Ot9E.png (22KB, 300x303px) Image search: [Google] [Yandex] [Bing]
pS9Ot9E.png
22KB, 300x303px
has anyone bought shit from aliexpress?I tried to buy a tablet and know aliexpress wants my bank statement id and credit card to verfy me
29 posts and 1 images submitted.
>>
>>51659227
I wouldn't trust them to be honest. Buy a tablet from somewhere else.
>>
>>51659227
While I don't trust chinkshits, it's literally the same thing as Ebay if not better sometimes.
>>
I've bought from them on numerous occasions. They're my main suppliers for micro controllers and tiny electronics. They're for when you don't want to negotiate with some supplier over Alibaba (i.e. small batches of stuff).
They're essentially Chinese eBay with one big difference: CONFIRMING GOODS RECEIVED MEANS FORFEITING YOUR RIGHT TO A RETURN OR REFUND.
Other than that can confirm AliExpress is legit, shipping slow as hell though. It's from China, what're you gonna do.

File: wafmqh2sugjlsf2awqve.jpg (97KB, 620x856px) Image search: [Google] [Yandex] [Bing]
wafmqh2sugjlsf2awqve.jpg
97KB, 620x856px
Hey /g/ remember that magic stick vaporware product a a month ago or so...
https://www.indiegogo.com/projects/magicstick-most-powerful-pc-stick-8gb-ram#/story

Apparently the have a bunch of news sites reporting about them. Are people really that stupid.
27 posts and 5 images submitted.
>>
>>51659208
>mfw they raised 500k
>>
>>51659208
Can't a Chromecast/Amazon Fire Stick/Android device/PC/Raspberry/C.H.I.P./Console/Aliexpress minibox already do this?
What's the point if it doesn't have high specs?
>>
Why would people report this.

File: sureIcan.jpg (147KB, 1199x600px) Image search: [Google] [Yandex] [Bing]
sureIcan.jpg
147KB, 1199x600px
Let's see who can do better /g/
60 posts and 24 images submitted.
>>
File: template.jpg (49KB, 1199x600px) Image search: [Google] [Yandex] [Bing]
template.jpg
49KB, 1199x600px
>>
File: 1449114955337.jpg (176KB, 1199x600px) Image search: [Google] [Yandex] [Bing]
1449114955337.jpg
176KB, 1199x600px
Meme reporting in
>>
>>51659357
I like you.

>>51659185
aaahhh too much non-Free software, I hope You've got nothing to hide(tm).

Pages: [First page] [Previous page] [3129] [3130] [3131] [3132] [3133] [3134] [3135] [3136] [3137] [3138] [3139] [3140] [3141] [3142] [3143] [3144] [3145] [3146] [3147] [Next page] [Last page]
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK