
Get a simple program in "BASIC" code to run
- or -
Post a project like this2013
£25(approx. $34)
- Posted:
- Proposals: 4
- Remote
- #2757507
- Awarded
Description
Experience Level: Entry
I have a simple program that I need to get running using PC-BASIC:
http://robhagemans.github.io/pcbasic/index.html
The job is to get the small program listed below up and running and then deliver to me a working .BAS file which I can then run using my own copy of PC-BASIC.
The code is listed below along with a sample of test data that can be used to ensure the program is running correctly.
Cheers – Andy
*******TEST DATA***********
"HOW MANY ATTRIBUTES"
>5
“HOW MANY ALTERNATIVES”
>3
“ATTRIBUTES:”
>APPEARANCE
>COST
>SAFETY
>PERFORMANCE
>RELIABILITY
“ALTERNATIVES”
>PLASTIC
>FABRIC
>PAPER
“RATING FOR APPEARANCE”
>.33
“PRIMARY DECISION FOR APPEARANCE”
>60
>70
“RATING FOR COST”
>.27
“PRIMARY DECISION FOR COST”
>45
>20
“RATING FOR SAFETY”
>.18
“PRIMARY DECISION FOR SAFETY”
>55
>85
“RATING FOR PERFORMANCE”
>.14
“PRIMARY DECISION FOR PERFORMANCE”
>30
>40
“RATING FOR RELIABILITY”
>.08
“PRIMARY DECISION FOR RELIABILITY”
>55
>75
*********RESULTS FROM SOFTWARE SHOULD READ*************
“MERIT RATING OF ALTERNATIVES”
“.356 PLASTIC”
“.33 FABRIC”
“.313 PAPER”
**********BASIC coded Program listing starts here**************
100 PRINT CLS
110 PRINT”COMPUTER AIDED DECISION MAKING “
120 PRINT”-------------------------------------------------- ---------“
130 PRINT:PRINT
140 PRINT”PHASE 2 FORCED DECISION ANALYSIS”
150 PRINT
160 INPUT”HOW MANY ATTRIBUTES “;N
170 PRINT
180 INPUT”HOW MANY ALTERNATIVES “;P
190 DIMA$(N),L$(P),F(P-1),D(P),B(P),Z(P),K(N),Y(N),A(N,P),T(N)
200 PRINT
210 PRINT”ATTRIBUTES”
220 FORI=1TON:INPUTA$(I):NEXTI
230 PRINT
240 PRINT”ALTERNATIVES”
250 FORJ=1TOP:INPUTL$(J):nextj
260 PRINT:PRINT
270 REM CALC OF NORMALISED FORCES
28O PRINT:PRINT
290 FORI=1TON
300 PRINT
310 PRINT
320 PRINT”RATING FOR “;A$(I);INPUTK(I)
330 IF K(I)>1THEN320
340 PRINT
350 PRINT”PRIMARY DECISIONS FOR “;A$(I)
360 F=1:X=1
370 FORJ=1TOP-1;INPUTD(J):NEXTJ
380 FORJ=1TOP-1;B(J)=100-D(J)
390 F(J)=INT((B(J)/D(J))*1000+.5)/1000
400 X=X+F(J):NEXTJ
410 REM ADD & CONVERT TO UNITY TOTAL
420 Y(I)=INT((F/X)*K(I))*1000+.5)/1000
430 LETA(I,1)=Y(I)
440 FORJ=1TOP-1:Z(J)=INT(((F(J)/X)*K(I))*1000+.5)/1000
450 LETA(I,J+1)=Z(J)
460 NEXTJ
470 NEXTI
480 PRINT:PRINT
490 PRINT”MERIT RATING OF ALTERNATIVES”
500 PRINT
510 FORJ=1TOP:FORI=1TON
520 T(J)=T(J)+A(I,J):NEXTI
530 NEXTJ
540 REM BUBBLE SORT
550 FOR I=1TOP-1:FORJ=1TOP-1
560 IFT(J)>=T(J+1)THEN630
570 LETG=T(J)
580 LETV$=L$(J)
590 LETT(J)=T(J+1)
600 LETL$(J)=L$(J+1)
610 LETT(J+1)=G
620 LETL$(J+1)=V$
630 NEXTJ,I
640 PRINT:PRINT
650 FORJ=1TOP:PRINTT(J),L$(J):NEXTJ
http://robhagemans.github.io/pcbasic/index.html
The job is to get the small program listed below up and running and then deliver to me a working .BAS file which I can then run using my own copy of PC-BASIC.
The code is listed below along with a sample of test data that can be used to ensure the program is running correctly.
Cheers – Andy
*******TEST DATA***********
"HOW MANY ATTRIBUTES"
>5
“HOW MANY ALTERNATIVES”
>3
“ATTRIBUTES:”
>APPEARANCE
>COST
>SAFETY
>PERFORMANCE
>RELIABILITY
“ALTERNATIVES”
>PLASTIC
>FABRIC
>PAPER
“RATING FOR APPEARANCE”
>.33
“PRIMARY DECISION FOR APPEARANCE”
>60
>70
“RATING FOR COST”
>.27
“PRIMARY DECISION FOR COST”
>45
>20
“RATING FOR SAFETY”
>.18
“PRIMARY DECISION FOR SAFETY”
>55
>85
“RATING FOR PERFORMANCE”
>.14
“PRIMARY DECISION FOR PERFORMANCE”
>30
>40
“RATING FOR RELIABILITY”
>.08
“PRIMARY DECISION FOR RELIABILITY”
>55
>75
*********RESULTS FROM SOFTWARE SHOULD READ*************
“MERIT RATING OF ALTERNATIVES”
“.356 PLASTIC”
“.33 FABRIC”
“.313 PAPER”
**********BASIC coded Program listing starts here**************
100 PRINT CLS
110 PRINT”COMPUTER AIDED DECISION MAKING “
120 PRINT”-------------------------------------------------- ---------“
130 PRINT:PRINT
140 PRINT”PHASE 2 FORCED DECISION ANALYSIS”
150 PRINT
160 INPUT”HOW MANY ATTRIBUTES “;N
170 PRINT
180 INPUT”HOW MANY ALTERNATIVES “;P
190 DIMA$(N),L$(P),F(P-1),D(P),B(P),Z(P),K(N),Y(N),A(N,P),T(N)
200 PRINT
210 PRINT”ATTRIBUTES”
220 FORI=1TON:INPUTA$(I):NEXTI
230 PRINT
240 PRINT”ALTERNATIVES”
250 FORJ=1TOP:INPUTL$(J):nextj
260 PRINT:PRINT
270 REM CALC OF NORMALISED FORCES
28O PRINT:PRINT
290 FORI=1TON
300 PRINT
310 PRINT
320 PRINT”RATING FOR “;A$(I);INPUTK(I)
330 IF K(I)>1THEN320
340 PRINT
350 PRINT”PRIMARY DECISIONS FOR “;A$(I)
360 F=1:X=1
370 FORJ=1TOP-1;INPUTD(J):NEXTJ
380 FORJ=1TOP-1;B(J)=100-D(J)
390 F(J)=INT((B(J)/D(J))*1000+.5)/1000
400 X=X+F(J):NEXTJ
410 REM ADD & CONVERT TO UNITY TOTAL
420 Y(I)=INT((F/X)*K(I))*1000+.5)/1000
430 LETA(I,1)=Y(I)
440 FORJ=1TOP-1:Z(J)=INT(((F(J)/X)*K(I))*1000+.5)/1000
450 LETA(I,J+1)=Z(J)
460 NEXTJ
470 NEXTI
480 PRINT:PRINT
490 PRINT”MERIT RATING OF ALTERNATIVES”
500 PRINT
510 FORJ=1TOP:FORI=1TON
520 T(J)=T(J)+A(I,J):NEXTI
530 NEXTJ
540 REM BUBBLE SORT
550 FOR I=1TOP-1:FORJ=1TOP-1
560 IFT(J)>=T(J+1)THEN630
570 LETG=T(J)
580 LETV$=L$(J)
590 LETT(J)=T(J+1)
600 LETL$(J)=L$(J+1)
610 LETT(J+1)=G
620 LETL$(J+1)=V$
630 NEXTJ,I
640 PRINT:PRINT
650 FORJ=1TOP:PRINTT(J),L$(J):NEXTJ

Andy R.
100% (7)Projects Completed
9
Freelancers worked with
8
Projects awarded
50%
Last project
4 May 2020
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies