Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PROG 2 0 7 9 9 Assignment # 1 Due Date: May. 1 9 th , 1 1 : 5 9 pm For this assignment,
PROG Assignment #
Due Date: May. th: pm
For this assignment, you will write a total of small C programs.
This assignment will be graded out of and worth of your total marks for this course.
Submission requirements:
Create a file named YourName.c that will contains all main functions see the bottom of this assignment
Add your name on the top of the file
Upload the file named YourName.c to the SLATE drop box. Go to the bottom of this file. You will see how c file must looks like
There is penalty if each instruction is not followed
Note that the file that you will submit is c file contains main functions, so if you run that file definitely you get error. SO no worries. Each time your code run successfully insert it in the file that you will submit
Watch the recording of Monday May th after the break I explained the assignment and how to do submission
Translate the code below from Java to C
public class IntegerVariable
public static void mainString args
int a ;
System.out.printlna;
Translate the code below from Java to C
public class DoubleVariable
public static void mainString args double pi ;
System.out.printlnpi;
Translate the code below from Java to C
public class CharVariable
public static void mainString args
char c h;
System.out.printlnc;
Translate the code below from Java to C
public class StringVariable
public static void mainString args
String s "Hello Class....";
System.out.printlns;
Translate the code below from Java to C
public class Variables
public static void mainString args
int Math ; int English ; int Physics ;
double average ;
average doubleMath English Physics;
System.out.printlnThe average is average;
Translate the code below from Java to C
import java.util.Scanner;
public class MyScanner
public static void mainString args Scanner scan new ScannerSystemin; System.out.printPlease enter an integer :; int num scan.nextInt;
System.out.printlnThe input is num;
Translate the code below from Java to C
public class Postfix
public static void mainString args
int x ;
System.out.printlnx;
Translate the code below from Java to C
public class Prefix
public static void mainString args
int x ;
System.out.printlnx;
Translate the code below from Java to C
public class IfStatement
public static void mainString args
int x y z ; ifx if y
z x y;
System.out.printlnz is z;
else
System.out.printlnx is x;
Translate the code below from Java to C
import java.util.Scanner;
public class SwitchCase
public static void mainString args
Scanner scan new ScannerSystemin; System.out.printPlease enter an integer :;
int num scan.nextInt;
switch num
case :
System.out.printlnIn case ;
break;
case :
System.out.printlnIn case ;
break;
case :
System.out.printlnIn case ;
break;
Translate the code below from Java to C
public class ForLoop
public static void mainString args
forint i ; i ; i
System.out.printlni;
Translate the code below from Java to C
public class WhileLoop
public static void mainString args
int i ;
whilei System.out.printlni;
Translate the code below from Java to C
public class DoWhileLoop
public static void mainString args
int i ;
do
System.out.printlni;
whilei ;
Translate the code below from Java to C
public class IntArray
public static void mainStringargs
int array; forint i ; i array.length; i
System.out.printlnarrayi;
Translate the code below from Java to C
public class CharArray
public static void mainString args char arrayhello; forint i ; i array.length; i
System.out.printarrayi;
System.out.println;
Translate the code below from Java to C
public class ConstantVariable
public static final double pi ; public static void main
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