1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gregori [183]
3 years ago
12

Why is the given C++ program is not working?

Computers and Technology
1 answer:
Jobisdone [24]3 years ago
3 0

Answer:

Please find the edited program below:

#include<iostream>

#include <stdio.h>

using namespace::std;

int main()

{

char ch;

cout<<"Enter any letter: ";

ch=getchar();

if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u'|| ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U')

cout<<"Vowel";

else

cout<<"Consonant";

return 0;

}

Explanation:

We cannot input char type using cin, we need to use getchar, and it is under header file stdio.h. Also, for comparing we need to use == and not =. And corrrect way of including std is using namespace::std;

You might be interested in
Two systems are connected by a router. Both systems and the router have transmission rates of 1,000bps. Each link has a propagat
Lisa [10]

Answer:

Two systems are connected by a router. Both systems and the router have transmission rates of 1,000bps. Each link has a propagation delay of 10ms. Also, it takes router 2ms in order to process the packet (e.g. decide where to forward it). Suppose the first system wants to send a 10,000 bit packet to the second system. How long will it take before receiver system receives the entire packet.

Transmission time for first Router = 10,000 bits / 1000 bps = 10 seconds

Receiving time for seond route r= 10,000 bits / 1000 bps = 10 seconds

Propagation delay = 10ms = .01 seconds x 2 for two delays = .02 seconds

First router 2ms to process = .002 seconds

Add all the times together and we get 20.022 seconds which is the same as or 20 seconds and 22 ms

4 0
3 years ago
8.18 **zyLab: Schedule Generator Write this program using an IDE. Comment and style the code according to the CS 200 Style Guide
Lera25 [3.4K]

Answer:

huh

Explanation:

sfdghjklhgfdsghjkhgfdsfghjk

3 0
3 years ago
Write a user-defined function that calculates the GPA. For the function name and arguments, use the following: The input argumen
QveST [7]

Answer:

#include <iostream>

#include <vector>

using namespace std;

void calGPA();

vector<int> g;

vector<int> h;

int main(){

   char pushMore = 'y';

   int fg, fh;

   for (;;){

       if (pushMore == 'n'){

           break;

       } else{

           cout<< "Enter integer for grade: ";

           cin>> fg;

           cout<< "Enter integer for credit hours: ";

           cin>> fh;

           g.push_back(fg);

           h.push_back(fh);

           cout<< "Do you want to add more grade and credit hours? y/n: ";

           cin>> pushMore;

       }

   }

   calGPA();

}

void calGPA(){

   double total = 0, GPA;

   for (int i = 0; i < g.size(); ++i) {

        total +=  g.at(i) * h.at(i) ;

   }

   cout<< "The GPA is : "<< total/g.size();

}

Explanation:

The C++ source code above defines two vectors 'g' and 'h'. The latter holds the grades of a student while the former holds the credit hours for the subject taken. The void 'calGPA' function calculates and prints the student's GPA.

7 0
3 years ago
__________ Refers to the difference between the original analog data and the approximation of that data using the techniques for
otez555 [7]

Answer:

Quantizing error

Explanation:

In digitisation of analog signal refers to the rounding off of values which are approximately equal to the analog signals. The method of sampling chooses a few point on the analog signal and then these points are joined to round off the value to a near stabilised value. such process is known as Quantization. For any system, during its functioning, there is always a difference in the values of its input and output. The processing of the system results in an error, which is the difference of those values.

The difference between an input value and its quantized value is called a Quantization Error. A Quantizer is a logarithmic function that performs Quantization rounding off the value. An analog-to-digital converter (ADC) works as a quantizer.

8 0
3 years ago
In the bussiness cycle which term best fits the labeled point on the graph
andrew11 [14]
In the business cycle, the term that best fits the labeled point on the graph of Production output vs Time is Contraction
8 0
2 years ago
Other questions:
  • A company has a file server that shares a folder named Public. The network security policy specifies that the Public folder is a
    14·1 answer
  • Can someone help me, please
    7·1 answer
  • Chill and text part 2<br><br> (TEST) How do i copy apex questions
    10·2 answers
  • Robert is leading a project online that includes students from different cultures. Two of the students spend most of the time li
    7·1 answer
  • A _________ is automatically launched by some trigger and appears in front of the active window
    12·1 answer
  • What word describes a violation of copyright laws? What rights do copyright holders have over their work of art
    5·2 answers
  • How do you get lugia in pokemon alpha saphire
    6·1 answer
  • Question 7 Consider the following code:
    11·1 answer
  • Redesign the cover of science textbook using at least two different graphics​
    7·1 answer
  • The technologist has recorded the red cell morphology as macrocytic. which mcv value would confirm this observation?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!