Question

In: Computer Science

Find as many programming languages as possible which fit the following categories. When you find a...

Find as many programming languages as possible which fit the following categories. When you find a language which fits the category, indicate the following information:

  • The name of the language
  • The year the language was released
  • A sample bit of code to prove that the language belongs to the given category.

For full marks, you must find at least two languages for each category. To make the assignment more interesting, extra points will be awarded to the person who finds the most languages for each category. (That is, extra points are available for each of the categories.)

Categories

  1. Languages with a built-in integer data type.
  2. Languages with a built-in floating point data type
  3. Languages with a built-in decimal data type.
  4. Languages with a built-in complex number data type.
  5. Languages with a built-in character data type.
  6. Languages with a built-in mutable string data type.

Solutions

Expert Solution

1)Languages with a built-in integer data type are: C ,C++ ,JAVA :

C:

C language was released in the year:1972

Code for Built-in integer data type in C language:

#include <stdio.h>

int main()
{
    int n=10;
    printf("%d",n);

    return 0;
}

C++:

C++ language was released in the year:1985

Code for Built-in integer data type in C++ language:

#include <iostream>

using namespace std;

int main()
{
    int n=20;
    cout<<n;

    return 0;
}

Java:

Java language was released in the year:1995

Code for Built-in integer data type in Java language:

public class Main {
    public static void main(String args[]) {
      int x=10;
      System.out.println(x);
    }
}

2)Languages with a built-in floating-point data type are: C ,C++ ,Python :

C:

C language was released in the year:1972

Code for Built-in integer data type in C language:

#include <stdio.h>

int main()
{
    float n=10.8;
    printf("%f",n);

    return 0;
}

C++:

C++ language was released in the year:1985

Code for Built-in integer data type in C++ language:

#include <iostream>

using namespace std;

int main()
{
    float n=20.5;
    cout<<n;

    return 0;
}

Python:

Python language was released in the year:1989

Code for Built-in integer data type in Python language:

n=float(10.8)
print(n)

3) Languages with a built-in decimal data type are C#, Python:

C#:

C# language was released in the year:2000

Code for Built-in decimal data type in C# language:

using System;
class HelloWorld {
  static void Main() {
      decimal d = 389.5m; 
    Console.WriteLine(d);
  }
}

Java:

Java language was released in the year:1995

Code for Built-in decimal data type in Java language:

import java.math.BigDecimal; 
public class Main{ 
    public static void main(String[] args)  { 
        BigDecimal b =new BigDecimal("120.094321");
         System.out.println(b);
}
}

4)Languages with a built-in complex number data type are: Python,C++

Python:

Python language was released in the year:1989

Code for Built-in complex data type in Python language:

c=2+3j
print(c)
print(type(c))

C++:

C++ language was released in the year:1985

Code for Built-in complex data type in C++ language:

#include <iostream>      
#include <complex>       
using namespace std; 

int main() 
{     
   
  std::complex<double> mycomplex(17.0, 25.8); 
  cout << "Real part is: " << real(mycomplex) << endl; 
  cout << "Imaginary part is: " << imag(mycomplex) << endl; 
  return 0; 
} 

5)Languages with a built-in character data type are: C++, Java

C++:

C++ language was released in the year:1985

Code for Built-in character data type in C++ language:

#include <iostream>

using namespace std;

int main()
{ 
    char c='A';
    cout<<c;

    return 0;
}

Java:

Java language was released in the year:1995

Code for Built-in char data type in Java language:

public class Main {
    public static void main(String args[]) {
      char c='B';
      System.out.println(c);
    }
}

6)Languages with a built-in mutable string data type are: C#

C#:

C# language was released in the year:2000

Code for Built-in mutable string type in C# language:

using System;
using System.Text; 
using System.Collections; 
class HelloWorld {
  static void Main() {
      StringBuilder s = new StringBuilder("Code"); 
    Console.WriteLine(s);
    s=new StringBuilder("coding");
    Console.WriteLine(s);
  }
}

Thank you! if you have any queries post it below in the comment section I will try my best to resolve your queries and I will add it to my answer if required. Please give upvote if you like it.


Related Solutions

In many programming languages you can generate a random number between 1 and a limiting value...
In many programming languages you can generate a random number between 1 and a limiting value named LIMIT by using a statement similar to randomNumber = random(LIMIT). Create the logic for a guessing game in which the application generates a random number and the player tries to guess it. Display a message indicating whether the player’s guess was correct, too high, or too low. (After you finish Chapter 4, you will be able to modify the application so that the...
Some languages support many modes of parameter passing. Provide 2 examples using two different programming languages...
Some languages support many modes of parameter passing. Provide 2 examples using two different programming languages which support the user of the programming language deciding which to use when creating their method. (Programming Languages)
You are conducting a Goodness of Fit hypothesis test for the claim that the 4 categories...
You are conducting a Goodness of Fit hypothesis test for the claim that the 4 categories occur with the following frequencies: H0H0 : pA=0.15pA=0.15; pB=0.3pB=0.3; pC=0.15pC=0.15; pD=0.4pD=0.4 Give all answers as decimals rounded to 3 places after the decimal point, if necessary. Complete the table: Category Observed Frequency Expected Frequency A 29 B 56 C 29 D 50 What is the chi-square test-statistic for this data? Test Statistic: χ2=χ2= For a significance of level alpha = 0.005, what is the...
When a function can take another function as a parameter, how can type-checking occur? (Programming languages)
When a function can take another function as a parameter, how can type-checking occur? (Programming languages)
List the high-level benefits of programming languages and identify the particular language(s) which are most closely...
List the high-level benefits of programming languages and identify the particular language(s) which are most closely associated with each such specific benefit.
Looking into the future, describe one future technology and how you believe programming languages will have...
Looking into the future, describe one future technology and how you believe programming languages will have to adapt to make that technology successful
When hiring an employee, which do you believe is more important: person-organization fit or person-job fit?...
When hiring an employee, which do you believe is more important: person-organization fit or person-job fit? Explain your rationale, and use examples if possible. With your answer in mind, think about someone who you have worked with who was not a good fit and ended up leaving the organization. Share your insights as to why the individual left the organization. Please keep the person and organization anonymous. This post must be at least 250 words.
You can use any programming languages Using a random generator, compute 1000 integers between 1 and...
You can use any programming languages Using a random generator, compute 1000 integers between 1 and 1000. There will be duplicates in the array. Sort the array using bubble sort and merge sort. The two sorted arrays should agree. Then pick at random one element from your sorted array and use a binary search to find its position in the array.
In the simulation, for the Rutherford model, which of the following possible observations is correct when...
In the simulation, for the Rutherford model, which of the following possible observations is correct when you use greater energies? The incoming particles can reach closer to the nuclei. Their trajectories bend more.    The particles lose more energy before exiting the target area. The particles spread over a larger area. The particles are able to break apart some of the target nuclei. The particles excite higher electronic energy states.
For which of the following product categories would you expect consumers to be most likely to...
For which of the following product categories would you expect consumers to be most likely to use price as a cue to quality: a plastic garbage can, an in-home electronic air cleaner, or a bottle of multiple vitamins? Explain your reasoning.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT