Questions: 9 913

Answers by our Experts: 9 913

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 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


Write a program that will allow a student to compute for his equivalent semestral grade.

The program should ask the user should input his/her first name, last name, middle initial, and student number.

After, inputting everything above, the output will clear the current screen and a new screen should open. On the new screen, the user will then be greeted "Welcome, <firstname>! The program will then ask for the prelim grade, midterm grade and final grade of the student. The program should only accept grades 100 and below. After getting the three grades, the program should compute for the semestral grade. The computation of the semestral grade is as follows: 30%*PrelimGrade + 30%*midtermgrade + 40%finalgrade

After inputting all the grades, the screen should clear again and will proceed to another screen.


Remarks should be "Passed" or "Failed" Only.

Hint You may use the relational operators "AND(&&)" and "OR(||)" for your conditions.



Can you identify if Cody's name is spelled right? If so, then make a program that accepts four one-letter strings separated by space and print "Correct" if the inputted strings, combined in order, spell the name Cody correctly. If not, print "Wrong". It doesn't matter if it's in uppercase or lowercase, as long as it's spelled correctly, it's considered correct.


Now, will you take on this task?


input

1.First Character

2.Second Character

3.Third Character

4.Fourth Character


Create a program that will convert peso value into 5 different currency using functions. Let the user input the peso value and select a specific currency based on the menu.

Can you identify if Cody's name is spelled right? If so, then make a program that accepts four one-letter strings separated by space and print "Correct" if the inputted strings, combined in order, spell the name Cody correctly. If not, print "Wrong". It doesn't matter if it's in uppercase or lowercase, as long as it's spelled correctly, it's considered correct.




Now, will you take on this task?


input

1.First Character

2.Second Character

3.Third Character

4.Fourth Character


Create a program that will perform the default constructor.


Write a computeSphere() function that returns the volume and surface area. Implement a

main function which reads the radius, calls the above function and prints the result.


Pyramid Schemes

by CodeChum Admin

They said pyramids were created by aliens, so if you can make a pyramid you might be able to qualify as an alien.


Instructions:

  1. In the code editor, you are provided with a main() function that asks the user for an integer input n, and passes this value to the function call of the generatePattern() function.
  2. Your task is to implement this generatePattern() function which has the following description:
  3. Return type - void
  4. Function name - generatePattern
  5. Parameters - 1 integer n
  6. Description - this function prints a triangular pattern of letter T's based on the value of n. For more information, refer to the output in the test cases
  7. DO NOT EDIT ANYTHING IN THE MAIN

Input


1. Integer n

Output


Enter·n:·4
T
TT
TTT
TTTT




Comparing Characters

by CodeChum Admin

Most, if not all things have numeric values. That goes for characters too. In order to find out which character has a higher value, we have to compare them with each other and display the value of the higher character.


Instructions:

  1. In the code editor, you are provided with a main() function that asks the user for 2 characters, passes these characters to a function call of the getHigherValue() function, and then prints out the ASCII value of the higher character.
  2. Your task is to implement the getHigherValue function which has the following details:
  3. Return type - int
  4. Name - getHigherValue
  5. Parameters - 2 characters to be compared
  6. Description - the ASCII value of the higher character.
  7. Hint: Comparing characters in C++ is just like comparing integers.
  8. DO NOT EDIT ANYTHING IN THE MAIN

Input


1. First character

2. Second character

Output


Enter·first·character:·a
Enter·second·character:·h
Result·value·=·104
LATEST TUTORIALS
APPROVED BY CLIENTS