In this problem, you are required to use for/while loop only to implement a calculator using
++ (increment) and -- (decrement) operators only. The operations that your calculator shall
perform are limited, i.e. addition, subtraction, multiplication, division, remainder and
absolute. Your program shall ask the user about the two input values and an operator, and
then use the switch-case structure to run the required operation (addition, subtraction,
multiplication, division or absolute (symbol ~)).
Prototype are:
• int addition(int n1,int n2);
• int subtraction(int n1,int n2);
• int multiplication(int n1,int n2);
• int division(int num,int denom);
• int remainder(int num,int denom);
• int absolute(int num);
Perform the subnetting on the below IP Address and find out the number of networks, network of, first host, last host, and broadcast id of each network.
IP Address:103.204.177.0/30
a. Perform binary addition on given numbers: 20 1/16 and 71/4 .
b. Convert the following binary number into ASCII code and then into its equivalent decimal representation. 01001001010000010100110101011100
Write a function that takes an integer minutes and converts it to seconds.
Examples
convert(5) ➞ 300
convert(3) ➞ 180
convert(2) ➞ 120
design and implement a c++ function that accepts the path of a file, reads the values a set of numbers from the file and returns the mean and the standard deviation of the numbers in there
Exercise 2 : Mining Temperature Data
The highs and lows of the 3 first weeks of 2020 temperature data are available on a piece paper and we have decided to store
them in a three-dimensional array in which the first index represents the 3 first weeks of the year, and take the value from 0 to
2; the second index is numbered 0 through 6 and represents the days of the week, and the last index which is numbered 0 and
1, represents the day’s high and low temperatures, respectively.
(2.1) Write a C program that enables you to capture the 3 first weeks of 2020 temperature data, from the keyboard, and store
them in the array described above. You must check the validity of any data entered.
(2.2) Write functions to request the following:
(a) Any day’s high and low temperature
(b) Average high and low temperature for given week
(c) Week and day with the highest temperature
(d) Week and day with the lowest temperature
(2.3) Write a driver program to test your functions defined in (2.1) and (2.2).
Given a sentence as input, find all the unique combinations of two words and print the word combinations that are not adjacent in the original sentence in lexicographical order.
Temperature Conversion
You are given the temperature T of an object in one of Celsius, Fahrenheit, and Kelvin scales.
Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin.
Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9.
Formula to convert from Kelvin K to Celsius C is C = K - 273.
Here "C", "F", "K" represent that the temperature scale is in Celsius, Fahrenheit and Kelvin scales respectively.
The input contains the temperature (a number) and the unit of the temperature scale (C, F, K) without any space.
when I am using above question code i was unable to get units for output.
Foe example Expected output is
25.0C
77.0F
298.0K
But I am getting as
25
77.0
298please explain the errors in the code
What are ict
Write a program that calculates the area and keeps a count that how many times it has
calculated the area.
Page 4
1. Create a class area which has data members of length, width and area (int type).
2. It also has a static int member count, initialize it with zero.
3. Overload constructor of class and calculate area in it, pass the values of length and width
from main.(calculate the area three times).4. Create a static member function in class which tells that how many times area has been
calculated. (This function will return the value of count when called)
5. Write function of display and display the area along with the value of count