Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Convert the following programs to Java or C/C++ code. The red text is the information about the statements. After you finish copy/paste your codes in
Convert the following programs to Java or C/C++ code. The red text is the information about the statements. After you finish copy/paste your codes in a word document and upload it to the system. 1)Fortran 95 Example program ! Input: An integer, List_Len, where List_Len is less information about the code ! than 100, followed by List_Len-Integer values ! Output: The number of input values that are greater ! than the average of all input values Implicit none Integer Dimension(90) :: Int_List array definition, size 90 name Int_list Integer :: List_Len, Counter, Sum, Average, Result integer variable definition Result=0 Sum = 0 Read *, List_Len input from keyboard If ((List_Len > 0).AND. (List_Len Average) Then Result = Result + 1 End If End Do ! Print the result Print *, 'Number of values > Average is:', Result output to monitor Else Print *, 'Error - list length value not legal End If End 2) COBOL IDENTIFICATION DIVISION. PROGRAM-ID. IDEONE. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 77 n PIC Z9. variable definition, interger, namen 1 PROCEDURE DIVISION. ACCEPT n PERFORM UNTIL n = 20 DISPLAY n ACCEPT n END-PERFORM. STOP RUN. input from keyboard same as WHILE loop output to monitor 3) ADA with Ada.Text_10; use Ada.Text_10; with Ada. Integer_Text_10; use Ada. Integer_Text_IO; procedure Test is subtype Small is Integer range 0..99; Input : Small; begin loop infinite loop input from keyboard Get(Input); if Input = 20 then exit; else Put (Input); New_Line; end if; end loop; output to monitor end; 4) PASCAL program ideone; var x: integer; s:integer; begin x=3; S:=1; repeat S:=S+x; X:=X-1; until x=0; writeln(s); end. output to monitor 5) C# using System; public class Test { 2. public static void Main() { int n; while ((n = int.Parse(Console.ReadLine()))!=20) input from keyboard Console.WriteLine(n); output to monitor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started