Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,748 members, 7,824,155 topics. Date: Saturday, 11 May 2024 at 12:59 AM

(java Only) A Programming Challange. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / (java Only) A Programming Challange. (2536 Views)

How To Choose A Programming Language / What U Need To Know Before Learn A Programming Language (2) (3) (4)

(1) (2) (Reply) (Go Down)

(java Only) A Programming Challange. by dsypha(m): 10:05am On Jul 23, 2013
a college offers a course that prepares students for the state licensing exam for real estate brokers. Last year, ten of the students who completed this course took the exam. The colleve wants to know how well its students did on the exam. you've been asked to write a program to summarize the results. You've been given a list of these ten students. Next to each name is written a 1 if the student passed the exam.or a 2 if the student failed.

Your program should analyse the results of the exam as follows:

1. Input each test result (I.e , a 1 or a 2). Display the message "Enter result" on the screen each time the program requests another test result.

2. Count the number of each test types.

3. Display a summary of the test results, indicating the number of students who passed and the number who failed.

4. If more than eight students passed the exam, print the message "Bonus to instructor".

BONUS: Also present the algorithm u used in writing the program.
Re: (java Only) A Programming Challange. by CHARLYX9: 1:14pm On Jul 23, 2013
like have said previous they ain't any programmmer in naija all this people r just mouth watery folks
@op,this apparently sounds like a project given to u in skul to solve cuz i can't see why u need algorithm to guide you on how to go about it.mtcheww u beta dnt chew mre than yourself
*shouts quit programming op its nt a do or die affair*
Re: (java Only) A Programming Challange. by dsypha(m): 1:28pm On Jul 23, 2013
CHARLYX9: like have said previous they ain't any programmmer in naija all this people r just mouth watery folks
@op, this apparently sounds like a project given to u in skul to solve cuz i can't see why u need algorithm to guide you on how to go about it.mtcheww u beta dnt chew mre than yourself
*shouts quit programming op its nt a do or die affair*

dude, I saw this as an example in a book. I'm nt learnin programmin in skul, I read industrial chemistry. jus wanted to see hw d so called programners cn do it.
Re: (java Only) A Programming Challange. by CHARLYX9: 1:38pm On Jul 23, 2013
so i dnt still believe there exist any programmer in naija u might see people using functions like php,python to derive a solution that doesn't make them a programmer and if at all your still in doubt of it.ask urself how many mouth watering biatch who cum here every day by day to update that they have app and website only for u to find out that they clone d app/website and made some little modifications thats all.
#Team uselessnation.nothing works
Re: (java Only) A Programming Challange. by Javanian: 2:17pm On Jul 23, 2013
Two empty vessels doing what they know how to do best... undecided

1 Like

Re: (java Only) A Programming Challange. by javadoctor(m): 2:26pm On Jul 23, 2013
Javanian: Two empty vessels doing what they know how to do best... undecided
lol kiss
Re: (java Only) A Programming Challange. by Sundayademola(m): 2:46pm On Jul 23, 2013
CHARLYX9: so i dnt still believe there exist any programmer in naija u might see people using functions like php,python to derive a solution that doesn't make them a programmer and if at all your still in doubt of it.ask urself how many mouth watering biatch who cum here every day by day to update that they have app and website only for u to find out that they clone d app/website and made some little modifications thats all.
#Team uselessnation.nothing works
I smell frustration here,you can't go far with this attitude bro.

1 Like

Re: (java Only) A Programming Challange. by dsypha(m): 2:57pm On Jul 23, 2013
Javanian: Two empty vessels doing what they know how to do best... undecided



hey. watch it bro., dats nt funny. am learnin java. came acros ds example. thought it wil b fun 2 bring it here.
Re: (java Only) A Programming Challange. by ooman(m): 3:03pm On Jul 23, 2013
mumu thread, bitter thread
Re: (java Only) A Programming Challange. by dsypha(m): 3:50pm On Jul 23, 2013
ooman: mumu thread, bitter thread


simply because u don't know it doesnt make it a
mumu thread. its funny how some of you learn language basics nd call ursef a programmer. just this simply problem, nobody can even attempt d algorithm. its a pity... nd its not by force to comment, simply because u have a device dat access d internet, u tink u can write rubbish..... beta go nd get a life. they are quite a good number of programmers on nairaland. the good ones dont make noise... u won't even know unless u r told. not even in their names!

1 Like

Re: (java Only) A Programming Challange. by CHARLYX9: 4:53pm On Jul 23, 2013
dsypha:


simply because u don't know it doesnt make it a
mumu thread. its funny how some of you learn language basics nd call ursef a programmer. just this simply problem, nobody can even attempt d algorithm. its a pity... nd its not by force to comment, simply because u have a device dat access d internet, u tink u can write rubbish..... beta go nd get a life. they are quite a good number of programmers on nairaland. the good ones dont make noise... u won't even know unless u r told. not even in their names!
You just gat me cracking up which good programmer r u insinuating on that are on nairaland if not only 'hello world' whch they managed to know whatelse.lol
How many have of them has their own made apps/websites if not all those wapkanians you see all over the net disturbing i have an app and a websites even the so called moderators of programming section:javanian,javadoctor has nothing to show off.
#useless country
Re: (java Only) A Programming Challange. by elvis10ten(m): 7:50pm On Jul 23, 2013
Re: (java Only) A Programming Challange. by elvis10ten(m): 8:07pm On Jul 23, 2013
Thats my solution in php. I know php is not allowed, but if i give you my php code you might be able to learn how to do it in java. Beware of the above code, i have only proved it correct not tested it.
Re: (java Only) A Programming Challange. by collynzo2(m): 8:27pm On Jul 23, 2013
This is a very simple program, I am on mobile now. I'll post the solution in PYTHON later.
Re: (java Only) A Programming Challange. by dsypha(m): 8:43pm On Jul 23, 2013
elvis10ten: Thats my solution in php. I know php is not allowed, but if i give you my php code you might be able to learn how to do it in java. Beware of the above code, i have only proved it correct not tested it.


u tried, haven't seen d code sha, jus d result maybe u copy nd paste it here.
Re: (java Only) A Programming Challange. by elvis10ten(m): 8:48pm On Jul 23, 2013
CHARLYX9:
You just gat me cracking up which good programmer r u insinuating on that are on nairaland if not only 'hello world' whch they managed to know whatelse.lol
How many have of them has their own made apps/websites if not all those wapkanians you see all over the net disturbing i have an app and a websites even the so called moderators of programming section:javanian,javadoctor has nothing to show off.
#useless country
i see fustration and anger in all your post on this thread. Smh
Re: (java Only) A Programming Challange. by javaservlets: 5:54am On Jul 24, 2013
Na wa o! So much hostility here sha! To think that I was encouraged to join Naira Land. Mean while Dsypha if it is for your own learning purpose maybe you should make that clear next time that way people know how to take the competition. Because you asking for algorithm i started to wonder myself.

Indeed it should be a competition for beginners. A healthy competition always serves to improve the targeted skill. We should all be of good cheer.
Re: (java Only) A Programming Challange. by elvis10ten(m): 6:30am On Jul 24, 2013
java_servlets: Na wa o! So much hostility here sha! To think that I was encouraged to join Naira Land. Mean while Dsypha if it is for your own learning purpose maybe you should make that clear next time that way people know how to take the competition. Because you asking for algorithm i started to wonder myself.

Indeed it should be a competition for beginners. A healthy competition always serves to improve the targeted skill. We should all be of good cheer.
probably you can do more than that and help him with a well documented java code; thank you
Re: (java Only) A Programming Challange. by dsypha(m): 8:36am On Jul 24, 2013
elvis10ten: probably you can do more than that and help him with a well documented java code; thank you


abi oo, den wats d need of the comment? I'll post the solution from the book later, don't know why people think its my assignment from school.

1 Like

Re: (java Only) A Programming Challange. by collynzo2(m): 5:29pm On Jul 24, 2013
Sorry I just started studying programming and I know nothing about java for now.
Here is the result in Python:
Note: I've tested this code and it works perfectly.
.

passes = 0 # number of passes
failures = 0 # number of failure
studentCounter = 0 #number of students

# Process results
while studentCounter < 10:
result = input ("Enter result (1 = pass, 2 = fail): "wink

if result == 1:
passes += 1

else:
failures += 1

studentCounter += 1
print passes, "students passed and", failures, "students failed"

if passes > 8:
print "Bonus for instructor!"
Re: (java Only) A Programming Challange. by elvis10ten(m): 6:37pm On Jul 24, 2013
collynzo2: Sorry I just started studying programming and I know nothing about java for now.
Here is the result in Python:
Note: I've tested this code and it works perfectly.
.

passes = 0 # number of passes
failures = 0 # number of failure
studentCounter = 0 #number of students

# Process results
while studentCounter < 10:
result = input ("Enter result (1 = pass, 2 = fail): "wink

if result == 1:
passes += 1

else:
failures += 1

studentCounter += 1
print passes, "students passed and", failures, "students failed"

if passes > 8:
print "Bonus for instructor!"
please do you mind showing us where this code ran ?. I can't access prog.py blah blah.
Re: (java Only) A Programming Challange. by collynzo2(m): 8:06pm On Jul 24, 2013
elvis10ten: please do you mind showing us where this code ran ?. I can't access prog.py blah blah.
I ran it locally on my laptop. I have python installed
Re: (java Only) A Programming Challange. by collynzo2(m): 9:20pm On Jul 24, 2013
elvis10ten: please do you mind showing us where this code ran ?. I can't access prog.py blah blah.
http://ideone.com/nWIyFV
Re: (java Only) A Programming Challange. by elvis10ten(m): 9:58pm On Jul 24, 2013
collynzo2:
http://ideone.com/nWIyFV
i don't think thats what op wanted. No way to input values when the program is runned.
Re: (java Only) A Programming Challange. by collynzo2(m): 10:44pm On Jul 24, 2013
elvis10ten: i don't think thats what op wanted. No way to input values when the program is runned.
that's how the site is structured, you have to input the values together with the code. It's different with puthon on a computer. With my laptop I input the values one by one after running the program, when i get to the 10th value, it prints out the result.
Re: (java Only) A Programming Challange. by romme2u: 1:33am On Jul 25, 2013
if u have ever learnt C, u will see this example in a book by DEITEL tagged "C HOW TO PROGRAM".

it is used to illustrate iterative programming (i.e. using control structures like the if statement).

it is really simple. all u need to know is how to do the PROBLEM ANALYSIS stage of programming before going further.

This is a general programming idea not peculiar to JAVA alone.
Re: (java Only) A Programming Challange. by elvis10ten(m): 4:57am On Jul 25, 2013
romme2u: if u have ever learnt C, u will see this example in a book by DEITEL tagged "C HOW TO PROGRAM".

it is used to illustrate iterative programming (i.e. using control structures like the if statement).

it is really simple. all u need to know is how to do the PROBLEM ANALYSIS stage of programming before going further.

This is a general programming idea not peculiar to JAVA alone.
why all this. If its simple which i know it is help the guy with the java code. My knowledge of java is rusty. Give him the code so he can do a compare and contrast with his own.
Re: (java Only) A Programming Challange. by ooman(m): 5:13pm On Jul 25, 2013
//Scores.java

import java.util.Scanner

public class Scores{
private static int user, count, pass;

Scanner input=new Scanner (System.in);

public static void inputScores(){

pass=70;

System.out.println("Enter score" );
user=input.nextInt();

if (user > pass){

++count;

System.out.println(count + "number of students passed" );

}

if (count > 8 ){

System.out.println("Bonus to the instructor" );

}
}

/* I dont understand your second instruction so am omitting it*/

public static void main(String[] args){

inputScores();

}

}

/**
1. Get input from user
2. Check if input > pass
3. If yes, prefix increment count
4. Print the number of students who passed.
4. If count > 8, print message

*/



/* typed this on mobile, I have not even run it so excuse some silly bugs eh*/.
Re: (java Only) A Programming Challange. by JAVANESE(m): 12:44pm On Oct 20, 2013
dsypha:


abi oo, den wats d need of the comment? I'll post the solution from the book later, don't know why people think its my assignment from school.
u wan tel us say u jst start 2 dey read sum of deitel's buks abi?

1 Like

Re: (java Only) A Programming Challange. by dsypha(m): 6:29pm On Oct 21, 2013
JAVANESE:
u wan tel us say u jst start 2 dey read sum of deitel's buks abi?


Ode! Shift.....
Re: (java Only) A Programming Challange. by Danyl(m): 9:01pm On Oct 21, 2013
Cantel o I dey feel you o..

(1) (2) (Reply)

Whatsapp Group For Kotlin Users/developers / Which Is The Best Programming Language To Learn? / Html & Css

(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. 43
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.