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

The XYZ Telephone Company’s charges file, contains records for each call made by its subscribers during a month. Each record on a file contains the subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometres) and duration of the call in seconds.

Design an algorithm that will read the Tidy Phones charges file and produce a telephone charges report, as follows:

 

The cost of each call is calculated based on table 1.

Distance from Metroville

Cost($)/minute

Less than 25 km

0.35

25 <= km < 75

0.65

75 <= km < 300

1.00

300 <= km <=1000

2.00

Greater than 1000 km

3.00

 

Write C++ complete programs for the above problem. You program must use control structure and user defined function.

 


seconds.

 

As a junior programmer, you are required to design and write a complete C++ program that asked the user to enter subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometers) and duration of the call-in seconds. The user also needs to enter types of call either Local or International call.

 

The cost of each call is calculated based on Table 1.

 

Distance from Shah Alam

Cost(RM)/minute

 

Local

International

Less than 25 km

0.35

0.55

25 <= km < 75

0.65

0.85

75 <= km < 300

1.00

1.20

300 <= km <=1000

2.00

2.20

Greater than 1000 km

3.00

3.20

 

Your program should use the following:

 

1. Appropriate Control Structure

2. User Defined Function

3. Sets the decimal precision to be used to format floating-point values on output operations. (2 decimal places)

4. Set background and text colour for output


Using the Sieve Algorithm remove all non-prime numbers on the given below. (Show your complete solution.)



1. 2 3 4 5 12 13 15 24 25 29 38 39 43 57 58 61



2. 2 3 4 5 103 104 105 106 107 108 109 110 111 112 113 114 115

Using the consecutive Integer Checking Algorithm, solve the GCD of the following pair of numbers. (Show your complete solution.)



1. GCD (19, 7)

Solve for the Greatest Common Divisor (GCD) of the following pair of numbers using the Pseudocode of Euclidean Algorithm given



below. (Show your complete solution.)



while n ≠ 0 do



r ← m mod n



m ← n



n ← r



return m




1. GCD (248, 16)

Solve for the Greatest Common Divisor (GCD) of the following pair of numbers using the Basic Euclidean Algorithm. (Show your complete solution.) 1. GCD (700, 105)


1. Write C++ program, overload the unary decrement operator (--) , postix nd prefix





2. Write C++ program , overload the binary subtraction operator(-)




Les assume you create a system which asks the user for the number of students and the

number of test scores per student. A nested inner loop, should ask for all the test scores for one

student, iterating once for each test score. The outer loop should iterate once for each student

and take student name as input. After taking input for 3 test scores, calculate average for each

student. Take 3 test scores and 4 students.

Note: use do-while loops


 Man's Best Friend

by CodeChum Admin

We all know what man's best friend is. A dog! 🐶


Let's create one in our program using the pre-existing struct Dog provided.



Instructions:

  1. In the code editor, you are provided with the definition of a struct Dog. This struct needs a string value for its breed. Furthermore, you are provided with a displayDog() function which accepts a struct Dog as its parameter.
  2. Your task is to create a Dog, take in a string user input, and then set it as the Dog's breed.
  3. Finally, call the displayDog() function and pass that Dog you created.

We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.



Care to do it for me?



Input


A line containing two integers seperated by a space



Output


A single line containing an integer


1

LATEST TUTORIALS
APPROVED BY CLIENTS