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
amm1812
3 years ago
15

What is the difference between C and C++. If I know C, will it be hard to lean C++?

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

Explanation:

The difference between c and c++  are given below

(1) C does not support object oriented programming structure while c++ supports  object oriented programming structure.

(2) C does not support namespace concept while c++ support namespace concept

(3) C has a procedural language it means it follow top down approach while  C++ is object oriented it means it follow bottom up approach

(4) C does not support virtual function concept while C++ support  virtual function concept

( 5) The programming structure of c language is given below  

   #include<stdio.h> // header file

  void main()  //main method

{

//statement

}

Programming structure of C++

#include<iostream> // header file

 using namespace std;  // namespace

void main()  // main method

{

// statement

}

If anyone know C, will it be not hard to learn C++ because only the syntax will change but the logic of programming is not changed .The operator and most concept are similar in both the languages.

You might be interested in
Archie wants to optimize an XFS filesystem and minimize the chance of future corruption. Which of the following commands will co
svlad2 [7]

Answer:

The best answer is "B"

xfs_fsr

Explanation:

The is a typical format of the command to use:

xfs_metadump -o /dev/sdb1 /reviewxfs

6 0
3 years ago
Read 2 more answers
This program is to compute and write to a file the GPA for student scores read from an input file. The point values of the grade
VARVARA [1.3K]

Answer:

#Take input from the user

filename=input('Enter name of input file: ')

total_units=0#Total number of units for a student

total_score=0#Total score of a student

#Assign a score to each grade. I have reduced 0.33 for each grade. Change here if you need to

grade={'A':4.0,'A-':3.67,'B+':3.34,'B':3.01,'B-':2.68,'C+':2.35,'C':2.02,'C-':1.69,'D+':1.36,'D':1.03}

try:

with open(filename,"r") as input_file:#Open the file for input(reading)

output_file=open("GPA_output.txt","w") #Create and open GPA_output.txt if it doesn't exist for writing

for student_record in input_file:#read from input file

if("," in student_record):#if there is a , that means this is the student name

student_name=student_record.strip('\n')#Remove \n from student name

continue

else:

if(" " in student_record):#If a line contains spaces then its the student's grades for a course

student=student_record.split(" ")#Split to find the coursename, units and grade

#student[0]=coursename student[1]=units student[2]=grade

total_units+=int(student[1])#Calculate total units for 1 student

total_score+=int(student[1])*grade[student[2].strip('\n')]#Find the total score of a student

#grade[student[2]] will lookup for the score that we initialized earlier

#if student has a grade as A then this will look up as grade['A'] which will return 4

#Find the total score as product of this grade and units for this course

continue

else:

if(total_units>0):#Check if score has been calculated for a student earlier

print("in")

GPA=total_score/total_units#Calculate the GPA

output_file.write("%-26s%.2f\n" % (student_name, GPA))#Write the GPA and Student Name in the required format

total_units=0#reset the units

total_score=0#reset the score

if(total_units>0):#Essential for the case when the file doesn't end with a new line(Check if total_units is not 0) which means a record is pending

#to be written to the file

GPA=total_score/total_units#Calculate the GPA

output_file.write("%-26s%.2f\n" % (student_name, GPA))#Write the GPA and Student Name in the required format

total_units=0#reset the units

total_score=0#reset the score

input_file.close()#Close the input file

output_file.close()#Close the output file

except IOError as e:

print("Problem in Opening the required file")#Print a message if file cannot be opened

Explanation:

The program has been tested for all 3 scenarios mentioned i.e.

a. If the file ends without \n

b. If the file ends with 2 \n

c. If the file ends with 1 \n

PS: The Program will run irrespective of how it ends. Even if there are many \n at the end of file, the program will be fine.

3 0
3 years ago
In Word, a red wavy underline indicates a/an
insens350 [35]
It's B. grammar errors are blue and autocorrect suggestions produce a small dialog box. I'm unsure what D is, but it's not an underline.
6 0
3 years ago
In which phase of the software development life cycle is software tested in the same environment where it be used?
Keith_Richards [23]

Answer:

uhuuwuw

i

Explanation:

uuuuvgfbjfyrtrufuuuhuyh

4 0
3 years ago
A ______ is Data appended to, or a cryptographic transformation of, a data unit that allows a recipient of the data unit to prov
RUDIKE [14]

Answer:

The correct answer to the following question will be "Digital Signature".

Explanation:

Digital Signature or Authentication is a mechanism that assures that the meaning of a message has not altered during transit. Whenever you, the sender, digitally sign an agreement, use your formal and informal key pair to encrypt the content of the message.

It helps the data unit receiver to prove the origins and credibility of the data unit and to defend it against falsification.

You can use this Signature Certificates as follows:

  • For transmitting digitally agreed to sign and encrypted addresses.
  • To execute secure internet-based transactions or to recognize other partners in internet-based transactions.

Therefore, Digital Signature is the right answer.

7 0
3 years ago
Other questions:
  • The ____ cell on the worksheet is the one into which you can enter data.â
    15·2 answers
  • The title bar of a window tells you the name of the document or program that's being displayed in the window, and it also serves
    11·1 answer
  • 1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a s
    11·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • You are comparing cryptographic solutions to implement at your organization. Which two items should you focus on when you are ev
    12·1 answer
  • Explain set associative mapping<br>​
    10·1 answer
  • (Print distinct numbers) Write a program that reads in integers separated by a space in one line and displays distinct numbers i
    8·1 answer
  • Bloxburg Build can anyone help me
    14·2 answers
  • Give 5 examples for software ​
    9·1 answer
  • What do earthquakes and tsunamis have in common?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!