Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,662 members, 7,955,398 topics. Date: Sunday, 22 September 2024 at 03:18 AM |
Nairaland Forum / Science/Technology / Programming / Fed Poly Ilaro Test Question On Java (953 Views)
I Need Help On Java / A Question On 'java: How To Program' Deitel. / Must I Learn Everything On Java As An Android Developer? (2) (3) (4)
(1) (Reply)
Fed Poly Ilaro Test Question On Java by quadness(m): 4:37am On Jul 11, 2016 |
1). Write a Java program which prompts a user to input his username and authenticates a user that has a username with more than 10 character by displaying a massage "you have been granted access " else it displays "you have not been granted access " with the title as "Unsuccessful login" 2). (convert pounds into kilograms) Write a Java program that converts pounds into kilograms. The program prompts the user to enter a number in pounds, it to kilograms, and display the result. One pounds is 0.454 kilograms. Pls, help me out . |
Re: Fed Poly Ilaro Test Question On Java by FrankLampard: 6:15am On Jul 11, 2016 |
This is very basic. For question one, is it a console App. |
Re: Fed Poly Ilaro Test Question On Java by Fulaman198(m): 8:08am On Jul 11, 2016 |
quadness: If you read my tutorial you should learn this, but it's very easy. So I'll tell you how to do it, but I won't give you the code. You will need to import the class for SCANNING input. Create a String variable for username. You will use an "if" conditional statement to and check for the length of the username String. If the String's length is more than 10, then it's a successful login, else it will be an unsuccessful login. In regards to #2, you just need the conversion rate of pounds to kilograms (which you have). Again, you will use an input scanner class and store a variable to userPounds (which should be a double variable) and then just make sure that: userPounds = userInputKg * 1.454 You can do it man. |
(1) (Reply)
Web Developer Tutor Needed Urgently / APP And Website Testing Service.... / Be A PMP Manager
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12 |