Download Program 7.2. The program requests the user to input Test 1 mark. Contribution to the final mark will be calculated if the Test i mark is greater than or equal to 30%, and if the mark is less than 30% the student is required to re-sit the test. The contribution is 20% of Test 1 mark to the final mark. [Muat turun Program 7.2. Program tersebut meminta pengguna memasukkan markah Test 1. Sumbangan kepada markah akhir akan dikira jika markah Test 1 yang dimasukkan adalah lebih besar atau sama dengan 30%, dan jika kurang daipada 30% pelajar perlu menduduki Test 1 sekali lagi. Test 1 memberi sumbangan 20% kepada markah akhir] 1 //Program 7.2 2 tinclude 3 #include 4 www m 5 int main () { 6 double mark, final20p=0; 7 printf ("Enter your mark: "); scanf ("%lf", &mark); wwwww 10 11 if (mark >= 30) 12 printf ("TEST 1 -> Pass\n"); 13 final20p = ((20.0/100.0) * mark); 14 printf ("Contribution to final mark $d", 15 final20p); 16 if (mark < 30) 17 printf ("TEST 1 -> Fail\n"); 18 printf ("Please re-sit TEST 1\n"); 19 getch(); 20 return 0; 21 } i. Identify the logic errors from the program. [Kenal pasti ralat logik dari program tersebut] ii. Correct the logic errors. [Retulkan ralat loaik tersehut)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Download Program 7.2. The program requests the user to input Test 1 mark.
Contribution to the final mark will be calculated if the Test i mark is greater
than or equal to 30%, and if the mark is less than 30% the student is required
to re-sit the test. The contribution is 20% of Test 1 mark to the final mark
[Muat turun Program 7.2. Program tersebut meminta pengguna
memasukkan markah Test 1. Sumbangan kepada markah akhir
wwwwwww
www m
wwwww
akan dikira jika markah Test 1 yang dimasukkan adalah lebih besar
www
atau sama dengan 30%, dan jika kurang daripada 30% pelajar
ww awww
perlu menduduki Test 1 sekali lagi. Test 1 memberi sumbangan
www
ww W
20% kepada markah akhir]
1 //Program 7.2
2 #include <stdio.h>
3 #include <conio.h>
ww w
4.
5 int main () {
6 double mark, final20p=0;
7
printf ("Enter your mark: ");
wwww w
8
scanf ("%lf", &mark);
ww ww
10
11 if (mark >= 30)
12 printf ("TEST 1 -> Pass\n");
13 final20p
14 printf ("Contribution to final mark &d",
15 final20p);
www
= ( (20.0/100.0) * mark);
ww
16 if (mark < 30)
17 printf ("TEST 1 -> Fail\n");
18 printf ("Please re-sit TEST 1\n");
19 getch () ;
20 return 0;
21 }
wwwimg
ww
i. Identify the logic errors from the program.
[Kenal pasti ralat logik dari program tersebut)
ii. Correct the logic errors.
[Betulkan ralat logik tersebut]
Transcribed Image Text:Download Program 7.2. The program requests the user to input Test 1 mark. Contribution to the final mark will be calculated if the Test i mark is greater than or equal to 30%, and if the mark is less than 30% the student is required to re-sit the test. The contribution is 20% of Test 1 mark to the final mark [Muat turun Program 7.2. Program tersebut meminta pengguna memasukkan markah Test 1. Sumbangan kepada markah akhir wwwwwww www m wwwww akan dikira jika markah Test 1 yang dimasukkan adalah lebih besar www atau sama dengan 30%, dan jika kurang daripada 30% pelajar ww awww perlu menduduki Test 1 sekali lagi. Test 1 memberi sumbangan www ww W 20% kepada markah akhir] 1 //Program 7.2 2 #include <stdio.h> 3 #include <conio.h> ww w 4. 5 int main () { 6 double mark, final20p=0; 7 printf ("Enter your mark: "); wwww w 8 scanf ("%lf", &mark); ww ww 10 11 if (mark >= 30) 12 printf ("TEST 1 -> Pass\n"); 13 final20p 14 printf ("Contribution to final mark &d", 15 final20p); www = ( (20.0/100.0) * mark); ww 16 if (mark < 30) 17 printf ("TEST 1 -> Fail\n"); 18 printf ("Please re-sit TEST 1\n"); 19 getch () ; 20 return 0; 21 } wwwimg ww i. Identify the logic errors from the program. [Kenal pasti ralat logik dari program tersebut) ii. Correct the logic errors. [Betulkan ralat logik tersebut]
Expert Solution
steps

Step by step

Solved in 2 steps with 10 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY