Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

def indexing(arg_1, arg_2):

# Complete this function


word = input()

index = int(input())

# Call the indexing function


how to complete this code to get desired output by using above code


input:

chocolate

2


output:

o


input:

google

4

output:

l


Write a program in C# to get the largest element of an array using a function.


Test Data:


Input the number of elements to be stored in the array: 5


Input 5 elements in the array:


element - 0: 1


element - 1: 2


element - 2: 3


element - 3: 4


element - 4: 5


Expected Output:


The largest element in the array is: 5

On the same figure plot all four obtained powers in kW against time. Use different line styles for each power, e.g. solid line, dashed line, dotted line or dash-dot line. Add labels to all axes. Add title, legend and grid to the figure.


t = 0:1:100;    %Time Step

Load = 10;  % Ohms


P=[ ];       %power

Vel = [ ];   %Speed

Gear= [ ];   %Gear

SOC = [ ];   %Soc

V = [ ];     %Voltage

A = [ ];     %Current

for r=1:length(t)

    V(r)=100*rand;

    A(r) = V(r)/Load;

    P(r) = V(r) * A(r);

    Vel(r) = V(r)*rand();

    SOC(r) = Vel(r)*rand;

    Gear(r) = SOC(r)*rand();

end

scrsz = get(0,'ScreenSize');

Dim=0;

figure('Position',[scrsz(1)+Dim, scrsz(2)+Dim,scrsz(3)-20,scrsz(4)-100]);




    Use the battery voltage and current data imported to calculate the battery power P as follows 

    P = UI where P is the battery power [W], U is the battery voltage [V] and I is the battery current 


    [A] battery voltage in V [Pack Volts]

    battery current in A [Pack Amps]  


 2. Plot each variable listed below against time in a form of subplot. 

    There should be 6 subplots in a single figure aligned in 2 columns and 3 rows. 

    Use different line colour for each data. Add labels to all axes.

    • time in seconds [Time]

    • speed in km/h [Speed]

    • gear [Gear]

    • elevation in meters [Elv]

    • SOC (state-of-charge) in % [SOC]

    • battery voltage in V [Pack Volts]

    • battery current in A [Pack Amps]

%}


On the same figure plot all four obtained powers in kW against time. Use different line styles for each power, e.g. solid line, dashed line, dotted line or dash-dot line. Add labels to all axes. Add title, legend and grid to the figure.


Knowing that average acceleration in a time interval ∆t = ti+1 − ti can be expressed as 𝑎𝑖 = 𝑣𝑖+1 − 𝑣𝑖 / ∆𝑡


where vi+1 − vi is the change in velocity between successive measurements,


write a code to:

Calculate acceleration in m/s2 using speed and time data extracted from the dataset. Hint: You may use for ... end loop to complete this task.


Data extracted:

time in seconds [Time]

• speed in km/h [Speed] 

Using the Fare Matrix above, create a Python program (using any of the selection structures) that will accept distance in kilometer/s as input, and student or elderly passengers will pay the discounted rate, disabled passengers will get an additional 10% discount with the original discounted rate, otherwise the regular fare will be used as basis for the computation of fare. The output will be the total fare for the passenger.

1Using the np.array function create an np array from the data given above.

2Generate a scatter plot for the data.

3Plot dendrogram to visualize the clustering linkage


Data:[[5,3], [10,15], [15,12], [24,10], [30,30], [85,70], [71,80], [60,78], [70,55], [80,91],]


Write a c++ program that takes your name from keyboard and display the following if your name has 10 character your name is too long if it comprise between 5 and 9 character your name is medium if it comprise less than 5 character your name is too Short

Write a python function Read_Prime(fname, list) which takes a list of numbers as an input, use this number to write them in a file "primes.txt" . The function then read the file and return a list containing only prime numbers as shown in the example. Also, write the exception handling code to show the proper message


Write a program with a loop that repeatedly reads a string as input, where the string is either "duck" or "goose". The loop terminates when "goose" is entered. After the loop, your code should print out the number of "duck" strings that were read.


NOTE: When reading the input, do not display a prompt for the user. Use the input()function with no prompt string. Here is an example:


bird = input()


LATEST TUTORIALS
APPROVED BY CLIENTS