Write a program that will create a list of four animals, and will use a For loop to print out each of the animals in the list. First write an algorithm in the online editor below.
Write a Java program to do the following
a) Read the names of employeeid, name and salary of all employees.
b) Check whether the given employeeid is present in the array,
if it is not, print the name of the employee and the employeeid.
Write a Java program to do the following
a) Read two-dimensional array (3 x3)
b) Find the diagonal elements of the array
Write a Java program to obtain transpose of a 4 x 4 matrix. The Transpose of the matrix is obtained by exchanging the elements of each row. With the elements of the corresponding column.
Write a C# program to calculate simple interest.
The program should take the inputs for simple interest and display the result.
The program should ask the user to input Y if he wants to continue, else N to stop
Every time user enters Y, the program should take the inputs and calculate interest
Write a C# program to design menu driven temperature converter console application.
The program should show following options for temperature conversion to user:
The program should then prompt user to enter the temperature value.
The given value should be converted to the required temperature unit, based on the choice inputted by user.
Design & Implement a C- program that can handle salesmen records of ABC
Company. Each salesman has unique 4-digit id #, name, salary, monthly sale &
commission (commission is computed depending on value of monthly sale). Net
income of a salesman is salary plus commission. Make maximum use of user
defined Functions.
Conditions for calculating commission are as follows:
➢ Commission is 20% of monthly sale, if sale is equal to or greater than 15,000.
➢ Commission is 15% of monthly sale, if sale is equal to or greater than 10,000
and less than 15,000.
➢ Commission is 10% of monthly sale, if sale is equal to or greater than 8,000
and less than 10,000.
➢ Commission is 5% of monthly sale, if sale is equal to or greater than 5,000 and
less than 8,000.
➢ No Commission, if sale is less than 5,000
What are the output of the program given below?
Program 1
#include <iostream>
using namespace std;
int main(){
int width = 10;
int height = 15;
double wide;
cout<<"PROGRAMME TO CALCULATE WIDE FOR TRIANGLE\n";
cout<<"##############################\n";
wide=0.5*height*width;
cout<<"\nWIDE: "<<wide<<"\n";
cout<<"\n##############################################\n";
return 0;
}
Program 2
#include <iostream>
using namespace std;
int main()
{
int x = 180, y = 200;
y = ++x;
cout << " x : " << x << endl << " y : " << y << endl;
}
Consider the following instructions
rpt $t2, Label1 # $t2 = $t2 – 1, if($t2 != 0) then PC = PC + 4 + SE(imm)
else PC = PC + 4
a) If we want to add this instruction to the MIPS machine instruction set, select the appropriate template and describe its details.
b) Now instead of adding this instruction, write the shortest piece of code in MIPS which is equivalent to the instruction above.
consider the following program :
void main()
{
int i;
printf(“Please enter an integer: ”);
scanf(%d,&i);
printf(“\n”);
switch(i) {
case 1: printf("I am one.\n"); break;
case 2: printf("I am two.\n"); break;
default: printf("I am neither one, nor two.\n"); }
}
///////////////////////////////////////////////////////////////////////
What you see below is part of the assembly code of the above program. Complete it using MIPS assemby and use “jump address table“ method.
.data
prmt: .asciiz "Please enter an integer: "
nline: .byte '\n'
.text
.globl main
main:
li $v0,4
la $a0,prmt
syscall
li $v0,5
syscall
addi $a0,$v0,0
li $v0,1
syscall
la $t0,nline
li $v0,11
syscall
# place your switch statement's assembly program here
li $v0,10
syscall