Hi,
Answer 1-
using System;
public class Test1
{
public static void Main()
{
double c;
Console.Write("Enter an Operator(+,-,*,/):");
string op=Console.ReadLine();
Console.Write("Enter two Operands : ");
double n1= Convert.ToDouble(Console.ReadLine());
double n2= Convert.ToDouble(Console.ReadLine());
switch (op)
{
case "+":
c=n1+n2;
Console.WriteLine(" {0} + {1} = {2} ", n1,n2,c);
break;
case "-":
c=n1-n2;
Console.WriteLine(" {0} - {1} = {2} ", n1,n2,c);
break;
case "*":
c=n1*n2;
Console.WriteLine(" {0} * {1} = {2} ", n1,n2,c);
break;
case "/":
c=n1/n2;
Console.WriteLine(" {0} / {1} = {2} ", n1,n2,c);
break;
default:
Console.WriteLine("Default case");
break;
}
}
}
Screenshot-

Answer 2-
using System;
public class Test2
{
public static void Main()
{
double c;
Console.Write("Enter the number of bars:");
int val=Convert.ToInt32(Console.ReadLine());
if(val<0)
{
Console.WriteLine(" Number of bars can't be negative");
}
else
{
switch (val)
{
case 1:
c=0.75;
Console.WriteLine(" Cost of {0} bars is $ {1} ", val,c);
break;
case 2:
c=1.25;
Console.WriteLine(" Cost of {0} bars is $ {1} ", val,c);
break;
case 3:
c=1.65;
Console.WriteLine(" Cost of {0} bars is $ {1} ", val,c);
break;
default:
c=1.65+(val-3)*0.30;
Console.WriteLine(" Cost of {0} bars is $ {1} ", val,c);
break;
}
}
}
}
Screenshot-

1) [5 pts] Build a simple calculator using switch statements which can perform the four operations...
In-Class Assignment 4 (15 pts) Structured Programming, if Statements 1. Write a program that prompts the user to enter a value. Print a message stating whether the input value is less than zero or greater than zero or equal to zero. Submit a screenshot of output for each case. See below for sample output Microsoft Visual Studio Debug Console Microsoft Visual Studio Debug Console Microsoft Visual Studio Debug Console Enter a value 5 Enter a value you entered zero. Enter...
using Eclipse c++ Write a program that mimics a simple integer calculator using the switch statement. The program should prompt for two integer numbers and the operation to be performed as input. It should then output the numbers, the operator, and the results as illustrated below. Use a for loop to prompt the user for input seven times as illustrated below. Assume that the operands will always be valid integers. For division,the program should also output the remainder and check...
Write an ARM program that implements a simple four-function calculator and prompts the user to enter a pair of decimal integers (A and B) followed by a character that specifies one of the operators: ‘+’ for addition to compute A+B ‘-‘ for subtraction to compute A-B ‘*’ for multiplication to produce the product A*B ‘/’ for division to produce the quotient A/B. Input should be the pair of numbers followed by the operand followed by a return. For example...
Problem 3 (20 pts) It is required to write a Matrix Calculator Program using C Programming Language that could only perform addition, subtraction, and multiplication of two matrices of appropriate dimensions. Your program should prompt the user to select a matrix operation from a list of options that contains the aforementioned operations. Then, the user should be prompted to enter the dimensions of the two operand matrices. Next, your program should prompt the user to enter the elements of each...
Write an ARM program that implements a simple four-function calculator and prompts the user to enter a pair of decimal integers (A and B) followed by a character that specifies one of the operators: ‘+’ for addition to compute A+B ‘-‘ for subtraction to compute A-B ‘*’ for multiplication to produce the product A*B ‘/’ for division to produce the quotient A/B. Input should be the pair of numbers followed by the operand followed by a return. For example...
**This program is to be created using Visual Studio C#**Create as a Windows Form application** 1. Output a header in the console: "Program 1" 2. Next you will ask the user to enter three floats and read the values into variables. 3. Perform addition, multiplication, and division examples with the numbers entered. 4. Implicitly cast the floats into doubles. 5. Explicitly cast the floats into ints. 6. Use conversion methods to convert the floats into strings. 7. Ask the user...
Write a Java program which allows the user to perform simple tasks on a calculator. A series of methods allows the user to select an operation to perform and then enter operands. The first method displays a menu, giving the user the choice of typing in any one of the following: +, -, *, /, or % representing the usual arithmetic operators (Each operation should be done on numbers negative(-) to positive(+), positive(+) to negative(-), negative(-) to negative(-), and positive(+)...
with the correct answer please
5. Write a program in C++ that will perform the operation of a simple CALCULATOR. But its output will be as shown in the output Screen-short. Three(3) Marks Guideline for developing the application. Input Output 1. Start program with asking The output will be question whether user is willing 1. The chosen Operator to continue or not. 2. Calculated result 2. If answer is Yes, Like:- System will ask for c\Users\Alamgir Documents\Visual Studio 2008 Proje....
Using Java Write a simple calculator which can add, subtract, multiply, and divide. Here are the specifications for the calculator: The calculator has one “accumulator”, which holds the result of all prior calculations. The calculator is set to 0.0 when the calculator is turned on (i.e., instantiated). On the console, the user then enters an operator (+, -, *, or /) and a number. Your console will then apply the operator and operand to the number in the accumulator, and...
Program Requirements First, find all the prime numbers between 2 and a user-inputted number from the console (inclusive). The identified prime numbers must be stored in an array . The inputted number should be between 0 and 1000 (inclusive). array is large enough to o Make sure your hold all the prim e numbers. Dynamic memory allocation is not required for this assignment, so you can have unused space in your array Make sure you can handle the cases of...