Write a menu driven program that allow the user to perform any one of the following operations based on the input given by user i       Check number is even or odd ii      Check number is positive or negative iii     Printing square of the number iv     Printing square root of the number (use math.h) Use switch statement for a menu driven program. Also, use validation checks wherever necessary

Question

Write a menu driven program that allow the user to perform any one of the following operations based on the input given by user

i       Check number is even or odd

ii      Check number is positive or negative

iii     Printing square of the number

iv     Printing square root of the number (use math.h)

Use switch statement for a menu driven program. Also, use validation checks wherever necessary.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Hello, How can I store a whole book in a file in c language? I had some issues because the string is...

A: Robinson Crusoe is a novel by Daniel Defoe, first published on 25 April 1719. The first edition cred...

Q: Differentiate between intra - AS and inter -AS routing algorithm

A:   Intra-domain routing   Inter-domain routing Definition Routing within an AS(protocols k...

Q: A substring of a string is a contiguous sequence of characters from the string. For example, BC is a...

A: import java.util.*;class Test134 { public static void main(String args[]) {  Scanner sc = new Scanne...

Q: Packet Tracer Lab: Kindly check the below configuration and tell me that why i'm not able to ping my...

A: A ping use ICMP protocol which is different from TCP/IP and UDP protocols . The lack of getting ping...

Q: Event Listeners Go to the co_credit.js file in your editor. Create an event listener for the window ...

A: Actually, JavaScript is a programming language for the web.

Q: Not sure about the best way to address decimal to binary conversion

A: Click to see the answer

Q: Give the transition diagram of a standard Turing Machine that implements the function. Briefly expla...

A: Actually, transition is a changing from one state to another.

Q: Create a program named TipCalculation that includes two overloaded methods named DisplayTipInfo. One...

A: Program approach: create a class  define two overloaded method named DisplayTipInfo ()  one method ...

Q: Who in an organization should decide where in the organizational structure the information security ...

A: The first group of people we are going to look at play a role in designing, developing, and building...

Q: Two elements with identical keys should have the same hash code. Group of answer choices True False

A: The, answer has given below:

Q: Subject:Database

A: Closure Sets Of F+ is all three sets and closure of B+ is second one( in bold) {A}+= {A,B,C,D} {B}+=...

Q: please provide some explanations to help me understand the topic.

A: CFG is the short form of Context Free Grammar. It is used to generate all possible patterns of the s...

Q: Create a class called Employee that includes four pieces of information as data members — a first na...

A: Program code: #include <bits/stdc++.h>using namespace std;class Employee{    public:        //...

Q: The monthly payment for a given loan pays the principal and the interest. The monthly interest is co...

A: Actually, the given information is : The monthly payment for a given loan pays the principal and the...

Q: 2. Write a program that reads the radius of the circle inscribed inside the square and based on that...

A: Below is the required code in C language. Program Approach: Include a necessary header files to ge...

Q: Let's say you have an integer array and a string array. You have to write asingle method printArray ...

A: Program: //created class ArrayPrintpublic class ArrayPrint { //created main method public static voi...

Q: Define the terms, foreground and background, in a multitasking operating system. Describe how a comp...

A: Step 1:- Note:-As per our policy, We are entitled to answer the first question only. Operating Syste...

Q: Use the recursion tree method to solve each of the following recurrences: (a) T(n) =T(n/10) +T(9n/10...

A: The following is the given recurrence relation:- T(n)=T(n/10)+T(9n/10)+O(n2) Here the shortest leaf ...

Q: Assume that bit P2.2 is used to control an outdoor light and bit P2.5 a light inside a building. Sho...

A: PROGRAM:   SETB C                   ; CY = 1 ORL C,P2.2            ; CY = P2.2 OR CY MOV P2.2,C     ...

Q: In a python program you can simulate a magic square using a two-dimensional list. Write a function t...

A: #Set the number of NumOfRows and columns NumOfRows = 3 NumOfColumns = 3 MIN = 1 MAX = 9 #Define a fu...

Q: A set of ten BCD readings is stored in the ML 2050H. Write an ALP for 8085 to convert the numbers in...

A: Algorithm – Load 00H in a register (for carry) Load content from memory into register pair Move con...

Q: This is the question -  Write an application that throws and catches an ArithmeticException when you...

A: Answer: 1) take an integer input from the user  2) if the input number is positive then print the sq...

Q: For each item below, specify whether the statement is true (T) or false (F). A Database Schema keeps...

A: A database schema keeps the data in a database- True Each data model is based on a Database Manageme...

Q: Rest of code in image / This is a bad programming style since it is using goto.  // This is an spage...

A: The ask is to make the given program menu-driven with the different functions and errors resolved.

Q: Data Point F1 F2 P1 P2 1.5 1.5 P3 2 1.5 P4 1.5 P5 4.5 2 P6 2.5 7.0

A: Actually, given data set is: Data Point X Y P1 1 2 P2 1.5 1.5 P3 2 1...

Q: You have to construct a string “cmpmpcmpm” from a blank string. There are two ways to construct a st...

A: Click to see the answer

Q: Consider adding the string "F" to the following skip list. How many levels (or next references) shou...

A: Solution is in Step 2. 

Q: This a Python coding question: A palindrome is a word or a phrase that is the same when read both fo...

A: Step 1:-   Program Approach:- Accept the user input Use the while loop for iteration on the string ...

Q: Find SD and variance of these numbers : 600,470,170,430,300

A: Given numbers: 600,470,170,430,300 Variance: Steps to calculate variance: Find the mean that is ave...

Q: Write an ALP for 8051 to transfer letter “ABC” serially at 4800 baud continuously. Use 8-bit data an...

A:   Algorithm – Load 00H in a register (for carry) Load content from memory into register pair Move ...

Q: Write python code Given list: numbers = [120, 200, 100, 50, 150]   Sort the list based on how close ...

A: By default, sort() doesn't need any additional parameters. However, it has two optional parameters.T...

Q: You will find the files needed for Problems 1 and 2 in the Module 8: Graphical User Interfacescourse...

A: Actually, java is a object oriented programming language. It is a platform independent.

Q: Consider any 12 distinct numbers (integers) and answer the following: a. Give steps to create a Bina...

A: NOTE: According to the guidelines, only the first 3 questions are answered a. Let the array of 12 di...

Q: * With comments in the code

A: 1. Algoeithm Step 1 - Construct a Binary Tree with given list of Elements. Step 2 - Transform the...

Q: This is the question -  Write an application in which you declare an array of eight first names. Wri...

A: GIVEN: Create a Java program and declare an array of eight first names. Write a try block. Get the i...

Q: Question 2Can we have option for Rewritable Optical Discs? If we have so how could this possible to ...

A: Solution: A electronic data storage medium which an write and read data  with the help of low-powere...

Q: # phyton A vector contains the grades obtained by students of a class in an assessment, with the fol...

A: import numpy as np list = input().split() list = [int(i) for i in list] grades = np.array(list)names...

Q: Write a program that prompts the user to enter 50 integers and stores them in an array. The program ...

A: Program Plan:- 1. Initialise all the required header files. 2. declare the array of 50 numbers. 3. a...

Q: Write bash script which takes array as an input of size 10 bind its even indexes to accept even valu...

A: The, script has given below:

Q: python question, where i did wrong??? i couldn't find problem

A: def main   main

Q: Question 24. Given an implementation of an algorithm, you want to check formally its run-time perfor...

A: Answer: It depends on the recursion in the algorithm This is because, if a function recursively cal...

Q: It is a Question from Discrete Mathematics , Topic Nested Quantifiers

A: (a) $\forall x \forall y((x < 0) \wedge(y < 0) \rightarrow(x+y<0))$(b) $\exists x \exists y...