PointerArray

PointerArray 1

Write a program that does the following using pointers: -asks the user for a number of elements that should be generated. Let’s call this number n (n >0 and n<100) -allocates space for n of integers -generates n random integers (0-1000) and store in the allocated space -prints out the number of stored elements that are divisible by 5 -deallocates the memoryThe sample run may look like the following> enter the number of elements> 10> No of elements divisible by 5 is 3

Aviation Alphabet

Aviation Alphabet 2

Write a program that prompts the user for a word, and displays the word in the Aviation Alphabet:

A = alpha H = hotel O = oscar V = victor
B = bravo I = india P = papa W = whiskey
C = charlie J = juliet Q = quebec X = x-ray
D = delta K = kilo R = romeo Y = yankee
E = echo L= lima S = sierra Z = zulu
F = foxtrot M = mike T = tango
G = golf N = november U = uniform

For example, the string: “Program” should be displayed as:
papa romeo oscar golf romeo alpha mike.

Your program should include a function that uses a switch to display the Aviation Alphabet equivalent of each character (whether upper OR lower case).

NamesList

NamesList 3

Write a program that asks for the user’s name, phone number, and address. The program then saves all information in a data file (each information in one line) named list.txt. Finally, the program reads the information from the file and displays it on the screen in the following format:Name: User’s Name
Phone Number: User’s Phone Number
Address: User’s Street Address
User’s City, State, and Zip Code

Chapter 1 & 2 – 3 C++ Programs

Chapter 1 & 2 - 3 C++ Programs 4

Q1: Write a program that prompts the user to enter five test scores and then prints the average test
score. (Assume that the test scores are decimal numbers.)

Q2: Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per
gallon the automobile can be driven. The program outputs the number of miles the automobile can be
driven without refueling.

Q3: A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose
that one gallon of paint can paint 120 square feet. Write a program that prompts the user to input the
lengths and widths of the door, each window, the bookshelf; and the length, width, and height of the
room (in feet). The program outputs the amount of paint needed to paint the walls of the room.

all_convert cpp

all_convert cpp 5

Write a templated function, named “all_convert”, that takes a const reference to a string and a pointer to an int. This function should convert the string to the templated type and return that. It should also adjust the int being pointed to to indicate the number of characters of the string that were converted (be sure to count leading whitespace too).You can assume that the string does not have any newline characters, and your function should ignore leading whitespace (like stoi does).

The user will enter three grades for exam

The user will enter three grades for exam 6

The user will enter three grades for exam, project, and lab.
* The three grades entered will be stated by the program.
* The program will determine and state the highest and the lowest of grade.
* The program will state the grades above or belore 70%
* The program will calculate and display the total grade average.

Mobile Service Provider

Mobile Service Provider 7

Programming Challenge 25: Mobile Service Provider(Page 228)For this program, make sure you include the following modifications- Make sure customer name and billing month is accepted. Billing month should be in the range 1-12. If it is not, please display an error message.- Make sure a user enters only ‘A’, ‘B’ or ‘C’ for the plan package code. Display an error message if any other letter is entered.- Only if a valid package code(‘A’,’B’, or ‘C’) is entered, then the user should be asked to enter the number of gigabytes used- Display a bill with month of bill, customer name, package code, charges included in package deal, and charge for additional data. Make sure you use identifying labels too.For Programming Challenge 25, you will need to send me the cpp file only .

A mobile phone service provider has three different subscription packages for its customers:

Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute.

Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute.

Package C: For $69.99 per month unlimited minutes provided.

Write a program that calculates a customer’s monthly bill. It should ask which package the customer has purchased and how many minutes were used. It should then display the total amount due.

Input Validation: Be sure the user only selects package A, B, or C.

FirstLastName

FirstLastName 8

Request a first and last name from the console.
Store each into a separate string variable

.Output the contents of both variables to the console three times:
1) separated by a space
2) separated by a tab
3) separated by a line

The program must precisely match the example output for credit.

For each of the following, write a single c++ statement that performs the specified task

For each of the following, write a single c++ statement that performs the specified task 9

1. For each of the following, write a single c++ statement that performs the
specified task. Assume that floating-point variables number1 and number2 have been
declared and that number1 has been initialized to 7.3. Assume that variable ptr is a type
of char *. Assume that arrays s1 and s2 are each 100-element char arrays that are
initialized with string literals.
a) Declare the variable fPtr to be a pointer to an object of type double.
b) Assign the address of variable number1 to pointer variable fPtr.
c) Print the value of the object pointed to by fPtr.
d) Assign the value of the object pointed to by fptr to variable number2.
e) Print the value of number2.
f) Print the address of number1.
g) Print the address stored in fPtr. Is the value printed the same as the address of
number2?

You are given a file consisting of students’ names

You are given a file consisting of students' names 10

You are given a file consisting of students’ names in the following form: lastName, firstName midddleName. (Note that a student may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastName. Your program must read student’s entire name in a variable and must consist of a function that takes as input a string, consists of a student’s name, and returns the string consisting of the altered name. Use the string function find to find the inex of ,; the function length to find the length of the string; and the function substr to extract the firstName, middleName, and lastName.

The input file looks like this:
Miller, Jason Brian
Blair, Lisa Maria
Gupta, Anil Kumar
Arora, Sumit Sahil
Saleh, Rhonda Beth

×
New Download