Computer Languages and how many know all three?

SydneyRoverP6B

Well-Known Member
Staff member
A group of 50 Engineering students are discussing the computer languages that they have learnt.

30 know Java
18 know C++
26 know C
9 know both Java and C++
16 know both Java and C
8 know both C++ and C
47 know at least one of the three languages.

(a) How many students know none of the 3 languages?

(b) How many students know all three languages?

(c) How many students know Java and C++ but not C?

(d) How many students know Java but neither C++ nor C?

Ron.
 
Unfortunately the question is flawed, if you know C++ then you also know C. C++ is an extension of C, I should know I've work with it for 20 years +

It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language and originally named "C with Classes". It was renamed C++ in 1983.
 
richarduk wrote,...
Unfortunately the question is flawed, if you know C++ then you also know C. C++ is an extension of C, I should know I've work with it for 20 years +

It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language and originally named "C with Classes". It was renamed C++ in 1983.

Hello Richard,

As you know C++ is an Object oriented language where as C is a structured language, so the paradigm is different. A person can learn C without knowing C++, although the converse would not be true as C++ is a superset of C as you mentioned.

For the sake of the question, please just treat them as distinct... :)

Hello Darth,

Yes indeed 47 and 3 are both correct.

Parts (c) and (d)?

Ron.
 
(a) How many students know none of the 3 languages? 3

(b) How many students know all three languages? 6

(c) How many students know Java and C++ but not C? 3

(d) How many students know Java but neither C++ nor C? 11
 
@quattro

I concur!

Trick was to do 47 - all the other bits to get the centre crossover of the venn diagram as 6 then everything else falls out in the wash. same for you?


Rich
 
and as a programmer i know enough people that write good c and bad c++ and vice versa to say that there's definitely at least a grey line between the two ;o)

Rich
 
quattro wrote,...
(a) How many students know none of the 3 languages? 3

(b) How many students know all three languages? 6

(c) How many students know Java and C++ but not C? 3

(d) How many students know Java but neither C++ nor C? 11

Hello Richard,

Yes indeed. :D I can see I'll have to pick a harder one next time to really test your mettle.. :wink:

Thanks Rich for your feedback and for supporting Richard's answers. Well done everyone.. :D

Ron.
 
I love these little quizes - they keep me occupied on a lunch hour at work :O)


Thanks for dreaming them up!
 
rockdemon said:
@quattro

I concur!

Trick was to do 47 - all the other bits to get the centre crossover of the venn diagram as 6 then everything else falls out in the wash. same for you?


Rich
and darth :eek:

If you draw three overlapping circles to represent the different languages and label the various sections from A to G then fill in what you know.

Java.jpg


Java = 30 (A+D+E+G)
C++ = 18 (C+E+F+G)
C =26 (B+D+F+G)
All is 47 (A+B+C+D+E+F+G)
Java and C = 16 (D+G)
Java and C++ = 9 (E+G)
C++ and C = 8 (F+G)

Then I just dropped these figures into a spread sheet

Simples – I’ll let you have a play with the speadsheet

8)
 
quattro said:

I'm sure that could be created with some c# on a web server. :)

Just a note, knowing C++ and C does not mean one knows C# and knowing c# does not equate to knowing C++ or C. Although C# has some similarities I would say it's diverge enough to be considered a difference language. But then I've completely missed the point of the original question................. I'll get my coat. :oops:
 
rockdemon wrote,...
I love these little quizes - they keep me occupied on a lunch hour at work :O)

Hello Rich,

Glad you like them too... :D

I have posted another, so see how you go with that one.

Ron.
 
Back
Top