Making and using a Dynamic-Link Library (DLL) from a Fortran procedure using Intel Fortran Compiler on Windows OS: getSquare()

Consider the following example Fortran function contained in Fortran module Square_mod which takes an input real number of type real64 and returns its square as output, module Square_mod implicit none contains function getSquare(val) result(valSquared) use, intrinsic :: iso_fortran_env, only: RK...

Calling Fortran function from other languages via a Dynamic-Link Library (DLL): getPower()

Consider the following example Fortran function contained in Fortran module Power_mod which takes an input real number base of type real64 and an integer variable expo of type int32 and returns $\mathrm{base}^{\mathrm{expo}}$ as output, module Power_mod implicit none contains function...

Passing characters and strings from C to Fortran and from Fortran to C

Problem Consider the following example Fortran function getLowerCase which takes a string of arbitrary length as input and converts all of the upper-case letters to lower-case and returns the result as the output string, module String_mod implicit none use, intrinsic...

Passing allocatable string from Fortran to C

Problem Consider the following example Fortran function replaceStr which takes a string of arbitrary length as input and search string. Then it searches for patterns in the input string that match the search string and replaces them with the input...

Data transfer: Converting Comma-Separated-Values (CSV) input to formatted output

Problem Consider this comma-separated data file: data.in. Write a simple script named csv2formatted that takes two input arguments representing the input and output file names. Then, the script writes the same input float data to the output file data.out in...

The while-loop implementation of for-loop

Problem MATLAB Consider the following two vectors of temperatures in Celsius degrees to Fahrenheit, using a for-loop and then prints them on screen. Cdegrees = [-20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40] Fdegrees =...

Version-control using Git and GitHub

Git Guidelines. Use the following Markdown language references, or any other reference that you find or prefer, to perform the tasks requested in this question. Markdown language cheat-sheet (pdf) Markdown language reference (web) Adam Pritchard’s Markdown cheat-sheet (web) Write the...

Simple GitHub page from README.md file

GitHub Problem Part 1 Design a simple GitHub page for your project, using the main directory’s readme.md file. Submit the link to the page as your answer. Note that you don’t need to add anything extra to your readme file....

value, variable, type, syntax error

Problem Type the following in the command window and submit the results. Briefly explain what each assignment does. a = 1 b = 'x' c = true whos a b c a == c a + c d = [1...

Computing the area of a triangle

Problem An arbitrary triangle can be described by the coordinates of its three vertices: $(x1,y1),(x2,y2),(x3,y3)$, numbered in a counterclockwise direction. The area of the triangle is given by the formula, \[A = \frac{1}{2} \bigg| x2y3 - x3y2 - x1y3 +...

Time required for cooking a refrigerated egg

Problem As an egg cooks, the proteins first denature and then coagulate. When the temperature exceeds a critical point, reactions begin and proceed faster as the temperature increases. In the egg white, the proteins start to coagulate for temperatures above...

String concatenation using for-loop

Problem MATLAB Consider the following nested cell array, q = {{'a', 'b', 'c'}, {'d', 'e', 'f'}, {'g', 'h'}} Write a for-loop that extracts all the letters in the list and finally prints them all as a single string, abcdefgh Python...

String concatenation using for-loop I

Problem MATLAB Consider the following nested cell vector, List = { {'M','A','T','L','A','B'}, {' '}, {'i','s'}, {' '}, {'a'}, {' '}, {'s','t','r','a','n','g','e'}, {', '}, {'b','u','t',' '}, {'p','o','p','u','l','a','r'}, {' '}, {'p','r','o','g','r','a','m','m','i','n','g',' ','l','a','n','g','u','a','g','e'} }; Write a MATLAB script extractLetter.m that uses for-loop to...

Simulating the Monty Hall game

Problem Suppose you’re on a game show, and you’re given the choice of three doors, Behind one door is a car; behind the two others, goats. You pick a door, say No. 1, and the host of the show opens...

Impact of round-off errors on numerical computations

Problem MATLAB Consider the following program, formatSpec = 'With %d sqrt, then %d times ^2 operations, the number %.16f becomes: %.16f \n'; % the string format for fprintf function for n = 1:60 r_original = 2.0; r = r_original; for...

Regression: obtaining the most likely mean and standard deviation of a set of Standard Normally Distributed Random Variables

Problem Consider this dataset, Drand.mat, which contains a set of random numbers. Let’s make a hypothesis with regards to this dataset: We assume that this dataset is well fit by a Gaussian distribution. But, we don’t know the values of...

Reading data from the World Wide Web

Problem Part A Consider the following web-page address https://cdslaborg.github.io/DataRepos_SwiftBat/index.html. This is an data table (in HTML language) containing data from the NASA Swift satellite. Each row in this table represents information about a Gamma-Ray Burst (GRB) detection that Swift has...

Python aliasing vs. copying variables

Run the following Python statements and briefly explain why you get the behavior displayed by the print functions. Problem Part A a = 5 b = a print (id(a), id(b)) c = b b = 3 print (a,b,c) print (id(a),id(b),id(c))...

Single-line Python input and string manipulation

Problem Part A Write a single-line Python code that reads a string containing comma-separated first-name, last-name, and the city in which a person lives from the Python interpreter command line, and simultaneously, in the same line of Python code, removes...

Python script full of syntax errors

Problem Python Download this code. This code is full syntax errors. Fix the errors and submit the corrected code with the name python_script_full_of_syntax_errors_fixed.py. Explain in front of each corrected Python statement, why the error occurred. On the last line of...