₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,030 members, 8,420,002 topics. Date: Thursday, 04 June 2026 at 09:11 AM

Toggle theme

Buster's Posts

Nairaland ForumBuster's ProfileBuster's Posts

1 2 3 4 5 (of 5 pages)

ProgrammingRe: Java Proramers:java Assignment: Can Someone Help Provide A Solution To This by buster(op): 8:22am On Nov 22, 2014
My email address is abbeybidmus@yahoo.com thanks so much I would be expecting it
ProgrammingJava Proramers:java Assignment: Can Someone Help Provide A Solution To This by buster(op): 7:53pm On Nov 21, 2014
Good evening

This is an assignment to a program am running in school. Despite all way of trying to get a code for it am still stuck and i have a deadline soon. Please kindly help out. The assignment is below

For the unit 2 assignment, you will develop a program that will simulate the rolling of a pair of dice. Your program must simulate rolling two dice and keep track of how many rolls are required before snake eyes are rolled (Note: “Snake Eyes” means that both dice show a value of 1). You will need to use a loop structure to repeatedly ‘roll the dice’. You will also need to make use of the if statement to determine if both die show a 1. You can use the example of an if statement below in your program and you can also read ahead to next weeks lesson for more information on the if statement.

To roll the dice, you can use the following Java statement which generates a random number between 1 and 6 (to represent the six sides of the dice).

die1 = (int)(Math.random()*6)+1

This statement has some interesting characteristics that need to be explained. The first thing we notice is that we are assigning something to a variable with the name die1. You will need to execute this statement twice, once for a variable die1 and the second time to assign to variable die2 to represent the roll of two dice.

The second thing we notice about this is this weird (int) placed in front of the parentheses that contain a subroutine call and a math expression (Math.random()*6).

What the (int) in this case is doing is called a cast. The cast is a way to force java to convert data from one data type to another.

The subroutine (actually this is calling the class Math and the method random) Math.random() will return a number that is between 0 and 1. This number is a floating point number.

By multiplying it by the number 6 we will get a random number between 0 and 5. This number will be a floating point number and is likely to be a fraction meaning that it will have digits to the right of the decimal point.

What the cast or (int) in this case does is convert this number into an integer. As you recall from earlier discussions, this will truncate all of the digits to the right of the decimal point. For example assume that that the Math.random() subroutine returns the value of .523432. This value is then multiplied by 6 resulting in 3.14059 to this we add 1 resulting in 4.14059. The reason that we are adding a 1 is because we want a number between 1 and 6 starting at 1. By adding a 1 we know that the starting number will always be 1 or greater.

What the (int) will do is to truncate everything to the right of the decimal point and then assign it to the variable die1. The resulting value in die1, in this case, would be 4.

An if statement that will test for ‘snake eyes’ would be as follows.

if (die1 == 1 && die2 == 1) {

// do something

}

You must complete your program, test, debug, and execute it. You must submit your java code file. Post the output of your program by specifying the number of rolls of the dice before you got snake eyes. Run the program at least five times and report your results.

Challenge: See if you can modify your program using a for loop to simulate running your program 1000 times and calculate the average number of rolls required to get snake eyes … what is the average number of rolls?
TravelRe: U.S. Immigration Questions: Ask A U.S. Consular Officer by buster(m): 10:13am On Oct 03, 2014
thanks so much for d reply. It really helped. Just wanna ask wats d waiting time if a us citizen files for son above 21yrs or is it d same duration wit lpr
TravelRe: U.S. Immigration Questions: Ask A U.S. Consular Officer by buster(m): 7:15pm On Oct 02, 2014
good evening vo. My mum is a green card holder but not yet a us citizen. Does she have to become a us citizen before she file for me.and also wats d waiting time for a mother who files for her son who is above 21 years. And i also want to ask if Hiv testing is compulsory during the medical exams. Thanks
TravelRe: U.S. Non-immigrant Visas: We’re Listening by buster(m): 10:55am On Sep 16, 2014
Good day VO. I am new to this thread and I need advise. I intend travelling to the USA for a medical conference in Georgia. A well known multi national hospital in India is willing to cover all expenses including flight ticket, hotel and all other expenses. I have a letter from the hospital stating they would cover the expense. But am a little bit worried because they didn't give me their statement of account. Is the statement of account needed at the embassy or would the embassy confirm themselves. And also do I need to present my own statement of account even if am not the one paying for the trip
TravelRe: A Comprehensive List Of The Documents Required For Visas by buster(m): 10:19am On Sep 16, 2014
Good day everyone. I am new to this thread and I need advise. I intend travelling to the USA for a medical conference in Georgia. A well known multi national hospital in India is willing to cover all expenses including flight ticket, hotel and all other expenses. I have a letter from the hospital stating they would cover the expense. But am a little bit worried because they didn't give me their statement of account. Is the statement of account needed at the embassy or would the embassy confirm themselves. And also do I need to present my own statement of account even if am not the one paying for the trip
TravelRe: Usa Visit Visa by buster(m): 10:16am On Sep 16, 2014
Good day everyone. I am new to this thread and I need advise. I intend travelling to the USA for a medical conference in Georgia. A well known multi national hospital in India is willing to cover all expenses including flight ticket, hotel and all other expenses. I have a letter from the hospital stating they would cover the expense. But am a little bit worried because they didn't give me their statement of account. Is the statement of account needed at the embassy or would the embassy confirm themselves. And also do I need to present my own statement of account even if am not the one paying for the trip
TravelRe: U.S. Immigration Questions: Ask A U.S. Consular Officer by buster(m): 10:14am On Sep 16, 2014
Good day everyone. I am new to this thread and I need advise. I intend travelling to the USA for a medical conference in Georgia. A well known multi national hospital in India is willing to cover all expenses including flight ticket, hotel and all other expenses. I have a letter from the hospital stating they would cover the expense. But am a little bit worried because they didn't give me their statement of account. Is the statement of account needed at the embassy or would the embassy confirm themselves. And also do I need to present my own statement of account even if am not the one paying for the trip
TravelRe: Main Reasons Many Are Refused Visas by buster(m): 9:50am On Sep 16, 2014
Good day everyone. I am new to this thread and I need advise. I intend travelling to the USA for a medical conference in Georgia. A well known multi national hospital in India is willing to cover all expenses including flight ticket, hotel and all other expenses. I have a letter from the hospital stating they would cover the expense. But am a little bit worried because they didn't give me their statement of account. Is the statement of account needed at the embassy or would the embassy confirm themselves. And also do I need to present my own statement of account even if am not the one paying for the trip
HealthRe: Reliability and Availability Of HIV Treatment In Nigeria by buster(m):
.
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 8:03am On Aug 14, 2012
Someone just informed me dat d change of course form is out. I don't know hw true
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 2:32pm On Aug 12, 2012
omidan21: Pls can a commercial student register for this human kinetics and health education course.if no pls what other options does a commercial student have
The entry requirement is credit in math, english, biology and any other 2 subject
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 9:59pm On Aug 11, 2012
alashor :
plz its d human kinetic diploma form is out?whre can i get it?
The form wld be out by ending of this month
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 2:21pm On Aug 11, 2012
I just heard dat d supplementary list wld be out anytime from now. Let's keep our fingers crossed. Expect d best
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 9:37am On Aug 10, 2012
For those that didn't make d cutoff, expecting d supplementary list or trying nxt year wouldn't be a bad idea. But av got some few options
-Get the Diploma Form, it cost 20k for d form and school fees is around 360k, u get admitted into 200 level after a year
-Get d diploma form in Human KInetics and Health Educations. THe forms costs 5k and school fees is arnd 70k per session for 2 years, and then u get admitted to 200 level of human kinetics
-VIsit www.uopeople.org, its an online tuition free university that offers DIploma and Bsc in Computer Science and Business Administration
- Enroll for an IT certification course in either NIIT,APTECH or NEW HORIZON
- Get the National Open University of Nigeria form to run a course of ur choice.
That's a piece of advice I cn offer. Cheers. Reply for more info of d above named programs
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 3:17pm On Aug 08, 2012
tdade: i hope you are wrong.
A lecturer who happens to be an school mate to ma mum told me.
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 3:06pm On Aug 08, 2012
Akosbaba: this is very possible,mr bidmus(dean,faculty of education) addressed this last year during the faculty orientation
What a coincidence, my Surname is Bidmus. lol
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 2:58pm On Aug 08, 2012
Just want to tell u all d bitter truth. I just confirmed there wouldn't be change of form this year. The supplementary list wld be released nxt week but it wld contain list of those dat are abt 3 - 5 marks to d cutoff mark. Its all because the faculty of education refused to be a dumping site for those dat do not make their faculty's cutoff point. Instead they would take any candidate that choosed education as their 1st choice so for d person score above an aggregate of 40
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 12:04pm On Aug 08, 2012
what course can i change too. My initial course was human kinetics and i had an aggregate of 49.38 and cutoff for human kinetics is 53 and my utme combinations are MATHS,ENGLISH,BIOLOGY and CHEMISTRY. and my O level combinations are MATH, ENGLISH, BIOLOGY, AGRIC AND ECONOMICS. Which course can i change too. Or better still is there a chance that i wld still be selected for human kinetics?
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 9:52pm On Aug 05, 2012
Am so sad right now. I am just gonna stick to my Human kinetics diploma form till its out. What a nyt for me
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 9:48pm On Aug 05, 2012
mjeasy: [/color][color=#006600]
jst search unilag admissions on fb,there u would c her post.
This girl is for real, she told me my jamb score and even my aggregate. Too bad I was not taken
EducationRe: Unilag 2012/2013 Post UTME/ Admissions (part III) by buster(m): 9:35pm On Aug 05, 2012
mjeasy: Guyz,there is a girl on fb who claims to be at d senate house at present,she has been helping peepz to check their names,i dont reli blv her but d convincing part is that she could tell their jamb nd putme scores without been told.all she needs is ur full name nd department..however,i avnt asked her to check mine....
I think its real, once u tell her ur name, she wld tell u ur jamb score and If u ve been taken
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 6:23pm On Aug 02, 2012
alashor :
plz giv me more info,are we goin 2 stay in hostel?hw sure u wil b admittd?and are we goin 2 write any b4 we get in?when is it goin 2 startd?
There would be an entrance examination before u get selected, but there are strong chances that u wld be selected because a lot of people do not enroll for d program. Classes wld possibly start by november and I guess d entrance exam wld be by september cos I was told d form wld only sell for just a week before its closed.
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 6:19pm On Aug 02, 2012
I confirmed from about 3 people and they said they heard d cutoff wld be changed. Let's all hope for d best
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 5:58pm On Aug 02, 2012
alashor :
plz itz dis programme i 4rm unilag ?
Sure its in unilag under d faculty of education.
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 7:04am On Aug 02, 2012
Sad new but true. I visited a professor who happens to be my Mum's school mate. I decide to meetb him to weigh my options since I didn't make d cutoff for human kinetics which is 53. He confessed to me that d change of course option is 20percent effective and nt reliable so he advised I get d foundation program form. The fees is expensive so he advised I wait till d diploma form for human kinetics. The diploma is a 2yr course which after u cross to 200 level in human kinetics. The form would be available in the 2nd-3rd week of august and it cost just 5k and school fees 78k per session. Its a good bargain for me since have done a health program before. If u are intrested pls visit the human resource board and development for more information.
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 4:37pm On Jul 27, 2012
Dgunnerz: What did he say again?
the cut off is out. check unilag site
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 4:15pm On Jul 27, 2012
Stesibelle17: I heard it is out also. Av bn tryin 2 check unilag site,bt its nt coming up. Am jux xo anxious
its true, i tried it again, the site is down. I guess they must be uploading. You know what, lets just forget about this forum for today and check unilag site first thing tomorrow morning.
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 4:11pm On Jul 27, 2012
ogagusps3: Unilag site is down... They must be uploading...
The site is not down, its open right here i my front. Its being open on my system since d release of d post utme results
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 4:10pm On Jul 27, 2012
i just hope d cut off is released today. Am damn so anxious
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 10:42am On Jul 27, 2012
hello room. I had an aggregate of 49.38 for human kinetics and am from Lagos state. What are my chances of gaining admission this year
EducationRe: Unilag 2012/2013 Post UTME/Admissions (Part II) by buster(m): 4:03pm On Jul 24, 2012
i was just told that it was pasted @ unilag mosque and cut off marks start from 45

1 2 3 4 5 (of 5 pages)