Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I was given a problem where I have to write the full code of a program following

ID: 3620650 • Letter: I

Question

I was given a problem where I have to write the full code of a program following the IPO model that converts a sentence case string the user enters into a title case string and also counts how many spaces are in the string excluding any spaces at the end. The programming software is G95 Fortran. We are only permitted to use loops and counters, string input, string functions(such as index, substrings, trim, achar, iachar, etc), and character manipulation. The exact directions and an example are given below. Please help!!


Key Concepts: loops and counters, string input, string functions, character manipulation

Write a program that follows the IPO model and converts a string from sentence case to title case, i.e. such that the first letter of each word in the string is capitalized. Also count how many spaces are in the string. Have the user enter the string to be converted, process it, and then output the converted string.

Here are a few notes:

* Note that a string might have spaces at the end of the string. These should not be counted.
* Determine the start of words by where spaces are in the string.
* Be careful to convert only lowercase letters. Don't manipulate any digits, other symbols, or letters that are already capitalized.
* When writing titles, certain words, like the articles "a" and "the" are not capitalized. You do not need to worry about this issue.
* You do not need to error handle, in that you may assume the initial string has the first letter of the first word is capitalized.


Sample Interaction

Enter a sentence case line to convert to title case:
Let's test this 1st string.

Converted string: Let's Test This 1st String.
Number of spaces: 4

Explanation / Answer

The Car class contains four class attributes, make, year, serialNumber, and color. We sometimes want to create a new Car object with the same make, year and color but with a different serial number, as another car. For example, if myCar is a red, 1999 VW, with serial number 4444, then this statement: myCar.create(2345); will create a new red 1999 VW with serial number 2345. Write the create method, which takes an int value -- the new serial number -- as an input parameter, and then creates a new Car object with the same make, year, and color values as the Car object being called, but with the new serial number. The method should return the newly created Car object. public class Car { public static final String FORD = "Ford"; public static final String GM = "GM"; public static final String SAAB = "Saab"; public static final String TOYOTA = "Toyota"; public static final String VW = "Volkswagen"; public static final String RED = "red"; public static final String BLUE = "blue"; public static final String WHITE = "white"; private String make; private int year; private int serialNumber; private String color; public Car(String mk, int yr, int serial, String cl) { make = mk; year = yr; serialNumber = serial; color = cl; } public Car create(int serial) {

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote