Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

: Write a program to perform basic to class conversion [Such as there is a class named: “conversion” with data members: feet and inches (both int)] Convert basic type(int) height in terms of total number of inches into equivalent feet and inches (class type) and display output on screen.


Indivisible Numbers(using nested for loops)



fin



number of positive integers K <= N such that K is not



for



4



5



You are given a positive integer N Your task is to find the divisible by any of the following numbers 2, 3, 4, 5, 6, 7, 8, 9, 10



6 prin



Custa



Input



The first line of input is an integer N



Output



The output should be an integer representing the number of positive integers satisfying the above condition.



Explanation



In the given sample input



N = 11



1 is not divisible by any of 2, 3, 4, 5, 6, 7, 8, 9, 10



2 is divisible by



2



3 is divisible by 3



11 is not divisible by any of 2, 3, 4, 5, 6, 7, 8, 9, 10



There are two numbers that are not divisible by 2, 3, 4, 5, 6, 7,



8, 9, 10



So the count is 2.



So, the output should be 2.


Sample Input 1



11



Sample Output 1



2



4



5



6 prin



Sample Input 2



12



Sample Output 2



2



Sample Input 3



268



Sample Output 3



47



Write a python program that implements a “Fahrenheit to

Celsius converter”. Upon program execution, the user is prompted to enter a

temperature in Fahrenheit and the program will output the corresponding temperature in

Celsius. The formula to convert a temperature given in Fahrenheit (F) to a

temperature in Celsius (C) is C = (F - 32)/1.8. Your solution should make use of floating

point (non-integer) values to obtain full marks. If you are not able to work with floating

point numbers, then provide an implementation with integer values (in this case, you can

use the following formula: C = (F - 32)/2. A solution that works only with integer values

will result in a decrease of marks but part marks will be provided.


Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. 

Ex: If the input is: 

5 10 5 3 21 2

the output is:

2 and 3

You can assume that the list of integers will have at least 2 values.

To achieve the above, first read the integers into a vector.

Hint: Make sure to initialize the second smallest and smallest integers properly.



Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a comma, even the last one. The output ends with a newline.

Ex: If the input is:

5 25 51 0 200 33
0 50

then the output is:

25,0,33,

(the bounds are 0-50, so 51 and 200 are out of range and thus not output). 

To achieve the above, first read the list of integers into a vector.


Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words.

Ex: If the input is: 

5 hey hi Mark hi mark

the output is: 

hey - 1
hi - 2
Mark - 1
hi - 2
mark - 1

Hint: Use two vectors, one vector for the strings and one vector for the frequencies.


Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. 

Ex: If the input is: 

5 50 60 140 200 75 100

the output is:

50,60,75,

The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75.

For coding simplicity, follow every output value by a comma, including the last one. 

Such functionality is common on sites like Amazon, where a user can filter results.


Imagine a class of TV with data members Name, brand, model and price. Give appropriate data types of data members. Write the following functions in this use case scenario.

·      Display function for all members and write this function outside of the class

·      Add three of constructors as discussed in class

·      Add destructor

·      Write setter and getter

·      Create object and call the function accordingly

·      All inputs should be user runtime inputs


Create a program named ConsoleAppException that divide 2 numbers and display the result. Ensure that your program implements the exception handling. Again, the program should have a constructor that initialize the result to zero. The calculation should happen in a method named Division() that takes two parameters (num1 and num2). The main method is only used to call the division() method . Use 25 for num1 and 0 for num2

Negative Allergy (JAVA)

by CodeChum Admin

Whole numbers are great, but I think we should also pay attention to decimal numbers, too.


So, how about we make a program that involves a lot of decimals?


Instructions:

  1. Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable.
  2. The loop shall only terminate for the following reasons:
  3. A negative decimal number is inputted (but still included in the total sum)
  4. The total sum reaches 100.0 or more

Instructions

  1. Continuously ask for floating point values (decimal numbers) using the do…while() loop, sum them all up, and store the total into one variable.
  2. The loop shall only terminate for the following reasons:
  3. A negative decimal number is inputted (but still included in the total sum)
  4. The total sum reaches 100.0 or more

Input

Multiple lines containing float number on each.

1.1
1.2
1.3
1.4
-1.0

Output

A line containing a float number with two decimal places.

4.00
LATEST TUTORIALS
APPROVED BY CLIENTS