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
Otrada [13]
3 years ago
7

Assume that name is a variable of type String that has been assigned a value.Write an expression whose value is a String contain

ing the last character of the value of name.So if the value of name were "Smith", the expression's value would be "h".
Computers and Technology
1 answer:
zhuklara [117]3 years ago
6 0

Answer:

#read value of name

name=input("Enter name:")

#find and ptint the last character of the string

print("last character of string is:",name[-1])

Explanation:

Read a string from user and assign it to variable "name".Find its last character as "name[-1]". Since name is character array,so name[-1] will give the last character of the array.

Output:

Enter name:Smith                                                                                                          

last character of string is: h

You might be interested in
Polymorphism means ______________.
Westkost [7]

Answer:

Polymorphism means that a variable of supertype can refer to a subtype object.

Explanation:

For example, in Python programming language, a function that accepts an iterable object uses the concept of polymorphism because that function can accept strings, lists, tuples as arguments.

5 0
3 years ago
Read 2 more answers
Return true if the given non-negative number is a multiple of 3 or 5, but not both. Use the % "mod" operator.
Pani-rosa [81]

the following C++ function will return true if the given non - negative number is multiple of 5 or 3 else it will return false.

bool function( int x ){

// variable to check if it is multiple of both or not

int number =0;

if(3%x == 0){

number++;

}

if(5%x == 0){

number++;

}

// Now returning by deciding

if( number <=1)

return true;

else

return false

}

4 0
3 years ago
What is the name of an instruction that interrupts a program being executed and requests a service from the operating system
tresset_1 [31]
“Interrupt” is what I think the answer is
7 0
2 years ago
Write a function called cipher(phrase,shift)that accepts two parameters: a string phrase and an integer shift.The integer shift
Aleks [24]

Answer:

Following is given the code according to requirement.

The code is attached as an image so that the indentation is understood by the user. Comments are given inside the code where necessary.

The output of code is also attached as well  in end.

I hope it will help you!

Explanation:

7 0
3 years ago
PLEASE HELP, PLEASE THIS C++ CODE WON'T WORK IDK WHY CFBundleDevelopmentRegion English CFBundleDisplayName DOSBox CFBundleExecut
skad [1K]

Answer:

Explanation:

There are such things as compiler bugs and even operating system bugs in which a program error-free itself fails to execute correctly.

For anyone including even the most experienced programmers, the overwhelming probability is that is not what is happening here.

There is only really one way to debug programs. Divide and conquer.

Enable all warnings in your compiler, find out what all the warnings mean, and drive them out or (not preferred) convince yourself that isn’t the problem

Keep trying to sub-divide the bit you think is wrong until you realize your error and fix it. If you come to the conclusion that bit is fine and the error exists earlier, but only exhibits at that point, change the program to test components in complete isolation.

If you come to a bit that you really can’t work out why it’s doing what it does, write a small standalone program that doesn’t do what you expect and post a question on Stack Overflow being clear about what you expect as the output and what you get.

Or

You didn’t write the correct instructions to reach your objective. It’s easy to write a program that nothing at all correctly and still compiles error-free. The compiler only spots the most glaring errors.

Hope this helps

5 0
3 years ago
Other questions:
  • A table with a width set to 600 pixels will look ________ on a monitor with resolution set to 640 × 480 than on a monitor with r
    10·1 answer
  • Buildings must be wired to comply with the latest National Electrical Code to ensure that, with adequate maintenance, the instal
    11·1 answer
  • Does anyone know any nitro type hack??
    13·2 answers
  • What will the value of x be after the following statements execute? int x = 0; int y = 5; int z = 4; x = y z * 2;
    14·1 answer
  • Your team will write a function that reverses a C-string, to practice using pointers. You must use pointers and C-strings for th
    6·1 answer
  • Which of the following problems is least likely to be solved through grid computing? Financial risk modeling Gene analysis Linea
    14·1 answer
  • What is the cpu used for
    6·1 answer
  • ¿Es aquel panel que controla la estructura de la tabla dinámica?
    14·2 answers
  • What number will be output by the console.log command on line 5?
    9·1 answer
  • What is the best wi-fi name you have ever seen?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!