Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,766 members, 7,820,674 topics. Date: Tuesday, 07 May 2024 at 07:15 PM

Programmers In The House, Pls Come To My Rescue - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Programmers In The House, Pls Come To My Rescue (1821 Views)

Somebody Pls Come To My Rescue / Programmers In Da House Pls I Nid Ur Help / How To Hire Good Programmers In Nigeria (an Experience Based Article) (2) (3) (4)

(1) (Reply) (Go Down)

Programmers In The House, Pls Come To My Rescue by braindollar(m): 1:28pm On Feb 05, 2015
I have an assignment to
1: Write a basic program that adds 10 numbers together and find the average
2: Write a program to input,store and compute the grade........................ Thanks in advance
Re: Programmers In The House, Pls Come To My Rescue by Urine: 1:35pm On Feb 05, 2015
braindollar:
I have an assignment to
1: Write a basic program that adds 10 numbers together and find the average
2: Write a program to input,store and compute the grade........................ Thanks in advance

Sigh! Ever heard of something called Google?
Re: Programmers In The House, Pls Come To My Rescue by Nobody: 1:53pm On Feb 05, 2015
what programming lanuage to use??
Re: Programmers In The House, Pls Come To My Rescue by phr33man(m): 1:58pm On Feb 05, 2015
make i try sha. guy i no b programmer oooo. make veteran programmers check d syntaxes if dem correct.

10 REM TO ADD TEN NUMBERS
20 INPUT A,B,C,D,E,F,G,H,I,J
30 LET S=A+B+C+D+E+F+G+H+I+J
40 PRINT S
50 END

UR COMMENTS R WLCM

THIS IS BASIC PROGRAM OOOOOOOOOOOO
Re: Programmers In The House, Pls Come To My Rescue by tresz: 2:07pm On Feb 05, 2015
You should be more specific
Re: Programmers In The House, Pls Come To My Rescue by braindollar(m): 2:25pm On Feb 05, 2015
phr33man:
make i try sha. guy i no b programmer oooo. make veteran programmers check d syntaxes if dem correct.
10 REM TO ADD TEN NUMBERS
20 INPUT A,B,C,D,E,F,G,H,I,J
30 LET S=A+B+C+D+E+F+G+H+I+J
40 PRINT S
50 END
UR COMMENTS R WLCM
THIS IS BASIC PROGRAM OOOOOOOOOOOO
tnx man wat of d average
Re: Programmers In The House, Pls Come To My Rescue by codemarshal08(m): 2:52pm On Feb 05, 2015
braindollar:
tnx man wat of d average
Average = sum of input divided by the count .
hint: from phr3 answer,
use S/10

For More: Google is ur friend
Re: Programmers In The House, Pls Come To My Rescue by Kovic08(m): 3:52pm On Feb 05, 2015
shaking my head cry
this one did not even say the language to use

( IT CAN BE DONE WITH C OR.C++ )
Re: Programmers In The House, Pls Come To My Rescue by nextstep(m): 9:32pm On Feb 05, 2015

#include <stdio.h>
#include <errno.h>

/*
* compile: gcc grades.c -o grades
* run: ./grades
* run: echo "80 90 90 100 -1 " | ./grade
*/

int main ()
{
int n, score, sum = 0;

printf ("type 10 scores or a negative number to stop adding\n" ) ;
for (n=0; n<10; n++) {

scanf("%d", &score);
if (score < 0)
break;
printf ("adding %d\n", score);
sum += score;
}

if (n>0)
printf ("average: %0.2g\n", (double)sum/n);
else
printf ("not enough scores given\n" ) ;
}
Re: Programmers In The House, Pls Come To My Rescue by Raypawer(m): 9:42pm On Feb 05, 2015
hm!
Re: Programmers In The House, Pls Come To My Rescue by ahmmyreal(m): 12:01am On Feb 06, 2015
// Using Java

import java.util.Scanner;
public class Average{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int counter = 0;
int total = 0;
int number;
double average;

for(int i=0; i<10; i++){
System.out.println("Enter a number: " );
number = input.nextInt();
total += number;
counter++;
}

average = (double)total / counter;
System.out.printf("Average is %.2f", average);
}

}
Re: Programmers In The House, Pls Come To My Rescue by Nobody: 7:12am On Feb 06, 2015
Modifying the JAVA Solution To Javascript:

var total=0;var counter=0;
for(i=0; i<10; i++){
number = prompt('Enter a number:',0);
total += parseFloat(number);
counter++;
}

average = total / counter;
document.write('Average is ' + average);

Let me attach a working example. @op, if you are not satisfied, I can still further downgrade it to pascal and fortran

Re: Programmers In The House, Pls Come To My Rescue by Aybee92(m): 8:28am On Feb 06, 2015
d op said basic language e.g Qbasic, power basic, liberty basic etc. java and c are not basic language na

1 Like

Re: Programmers In The House, Pls Come To My Rescue by braindollar(m): 11:37am On Feb 06, 2015
Aybee92:
d op said basic language e.g Qbasic, power basic, liberty basic etc. java and c are not basic language na
Yes cos I don't understand those oda language Am new to programming
Re: Programmers In The House, Pls Come To My Rescue by nextstep(m): 12:47pm On Feb 06, 2015
braindollar:

Yes cos I don't understand those oda language Am new to programming

I'm surprised anyone is still teaching classes in Basic when C, Java and JavaScript are the languages any modern programmer should be competent with. It's like learning Latin nowadays.

Is this for a class or self learning?
Re: Programmers In The House, Pls Come To My Rescue by Knownpal(m): 12:47pm On Feb 06, 2015
braindollar:
tnx man wat of d average

10 REM TO ADD TEN NUMBERS
20 INPUT A,B,C,D,E,F,G,H,I,J
30 LET S=A+B+C+D+E+F+G+H+I+J
30.1 LET AVE = S / 10
30.2 PRINT "AVERAGE ", AVE
40 PRINT "SUM ", S
50 END
Re: Programmers In The House, Pls Come To My Rescue by Knownpal(m): 12:49pm On Feb 06, 2015
nextstep:


I'm surprised anyone is still learning Basic. C java and JavaScript are the basic languages any new programmer should be competent with. It's like learning Latin nowadays

I think BASIC is better what of COBOL?
Re: Programmers In The House, Pls Come To My Rescue by Nobody: 3:44pm On Feb 06, 2015
Na wa o, see as all these guys just dey show off sef?
Re: Programmers In The House, Pls Come To My Rescue by nextstep(m): 4:38pm On Feb 06, 2015
If you were using a real high-level language (like scheme http://courses.cs.washington.edu/courses/cse341/03wi/scheme/basics.html), you'd write this:

(define (average numbers)
(/ (apply + numbers) (length numbers)))


without having to do so much housekeeping (like C or Basic force you to). You'd then run it like this:

(average 1 2 3)
Re: Programmers In The House, Pls Come To My Rescue by Nobody: 6:46pm On Feb 06, 2015
^^^you are on your own
Re: Programmers In The House, Pls Come To My Rescue by braindollar(m): 8:35pm On Feb 06, 2015
nextstep:

I'm surprised anyone is still teaching classes in Basic when C, Java and JavaScript are the languages any modern programmer should be competent with. It's like learning Latin nowadays.
Is this for a class or self learning?
Like I said earlier Am new to programming and I was to write basic because it's an assignment I don't hv a choice dan to write d basic. Tnx
Re: Programmers In The House, Pls Come To My Rescue by Aybee92(m): 9:03pm On Feb 06, 2015
braindollar:

Like I said earlier Am new to programming and I was to write basic because it's an assignment I don't hv a choice dan to write d basic. Tnx
what are u studying?
Re: Programmers In The House, Pls Come To My Rescue by Aybee92(m): 9:05pm On Feb 06, 2015
I did basic programing and c++ during my year 1 in school sha
Re: Programmers In The House, Pls Come To My Rescue by spoilerx: 1:28pm On Feb 07, 2015
braindollar:
I have an assignment to
1: Write a basic program that adds 10 numbers together and find the average
2: Write a program to input,store and compute the grade........................ Thanks in advance


I can do this on python, but no GUI , command line
Re: Programmers In The House, Pls Come To My Rescue by CRAZYMADMAN(m): 9:29pm On Feb 10, 2015
it's very interesting to note. that both questions can be found (with a slight modification) on deitel's book: Java how to program


very interesting undecided

(1) (Reply)

Connecting An Offline Server To An Online Server / Where Can I Learn Programming In Anambra,awka Precisely / Journey To Full Stack Developer

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