Question

In: Computer Science

Write a programme to read and print your phone number, your initials and your average. note:c++

Write a programme to read and print your phone number, your initials and your average.
note:c++

Solutions

Expert Solution

//code:

#include <iostream>

using namespace std;

int main()
{
   long long phone_number;
   char intials[100];
   float average;
   
   //prompt user 
   
   //phone number
    cout<<"Enter your phone_number : ";
    cin>>phone_number;
   
   //intials
   cout<<"\nEnter your intials : "; 
   cin>>intials;
   
   //average
   cout<<"\nEnter your average : ";
   cin>>average;
   
   //print phonenumber , intials and average 
    cout<<"\nyour phone_number is :"<<phone_number;
    cout<<"\nyour intials is : "<<intials;
    cout<<"\nyour average is : "<<average;
    return 0;
}

//screenshot of code

  1. long long stores typical range is -(2^63) to (2^63)-1
  2. sequence of characters is string hence char array is used to store string
  3. for average kind of things we can go for float or double

Related Solutions

write a programme named question5a.cpp that calculate and print pay slip
write a programme named question5a.cpp that calculate and print pay slip
Read a number N and print all its divisors.
Read a number N and print all its divisors.
Write a program in Python to print all possible combinations of phone numbers. The length of...
Write a program in Python to print all possible combinations of phone numbers. The length of the number will be given. Also 3 digits will be given, which can not be used. No two consecutive digits can be same. A number containing 4 would always have 4 in the beginning.
Write a python programme in a Jupyter notebook which asks the user to input the number...
Write a python programme in a Jupyter notebook which asks the user to input the number of radioactive nuclei in a sample, the number at a later time, and the elapsed time. The programme should calculate and display the decay constant and the half-life. The decay is described by the equations: ? = ? ?−?? ?0 ?1/2 = ln (2) . Test your programme a sample that contains 4.00x108 nuclei initially and 1.57x107 nuclei after 150 seconds. SO THEREFORE A...
Write a program to read in a collection of integer values, and find and print the...
Write a program to read in a collection of integer values, and find and print the index of the first occurrence and last occurence of the number 12. The program should print an index value of 0 if the number 12 is not found. The index is the sequence number of the data item 12. For example if the eighth data item is the only 12, then the index value 8 should be printed for the first and last occurrence....
Write an application, Phone Numbers, that creates and prints a random phone number of the form...
Write an application, Phone Numbers, that creates and prints a random phone number of the form XXX-XXX-XXXX. Include the dashes in the output. The phone number has some constraints. Do not let the first three digits contain an 3 or 7 (but do not be more restrictive than that) and ensure that the second set of three digits is not greater than 825. Note that any of the digits can be zero and zeroes should be shown.
1) Find a company whose ticker symbol contains your initials. (For example if your initials are:...
1) Find a company whose ticker symbol contains your initials. (For example if your initials are: BK, then Bank of New York Mellon (BK) or Barnes and Noble (BKS) or Ambac Financial Group (ABK) would satisfy this requirement). If you cannot find any company with your initials, then use one of your initials (you choose which) twice. So if your initial are: SV, choose a company with either 2 S’s or 2 V’s in the ticker. If there is still...
You have to write a program that will read an array from a file and print...
You have to write a program that will read an array from a file and print if the numbers in the file are right truncatable primes. A right truncatable prime is a prime number, where if you truncate any numbers from the right, the resulting number is still prime. For example, 3797 is a truncatable prime number number because 3797, 379, 37, and 3 are all primes. Input-Output format: Your program will take the file name as input. The first...
You have to write a program that will read an array from a file and print...
You have to write a program that will read an array from a file and print if the numbers in the file are right truncatable primes. A right truncatable prime is a prime number, where if you truncate any numbers from the right, the resulting number is still prime. For example, 3797 is a truncatable prime number number because 3797, 379, 37, and 3 are all primes. Input-Output format: Your program will take the file name as input. The first...
Write a C program to run on unix to read a text file and print it...
Write a C program to run on unix to read a text file and print it to the display. It should count of the number of words in the file, find the number of occurrences of a substring, and take all the words in the string and sort them (ASCII order). You must use getopt to parse the command line. There is no user input while this program is running. Usage: mywords [-cs] [-f substring] filename • The -c flag...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT